What This Script Does
The install-essential-apps.sh script is a focused, single-purpose tool designed to batch-install macOS applications from your Brew Scripts configuration file. While the full interactive setup script handles everything from Homebrew installation to shell configuration, this script assumes that Homebrew is already installed and working. Its sole job is to read your app preferences and install them efficiently using Homebrew Cask.
This script is particularly valuable in two scenarios. The first is after a clean macOS installation, when you have already set up Homebrew (perhaps using the full setup script or manually) and now need to rebuild your application collection. Instead of visiting dozens of websites, downloading individual installers, and dragging apps into your Applications folder one by one, this script handles the entire process in a single command. The second scenario is when you want to synchronize your app collection across multiple Macs — simply copy your config file to the new machine and run this script.
When executed, the script reads your config/homebrew-scripts.conf file and examines the category toggle flags. Each category — development tools, productivity apps, creative software, communication apps, and utilities — has its own boolean flag. For each enabled category, the script gathers the list of applications associated with that category and adds them to the installation queue. It also reads the CUSTOM_APPS array, which lets you specify additional applications beyond the predefined categories.
Before attempting to install any application, the script performs a duplicate check. It queries Homebrew to determine whether each app is already installed, either as a cask or as a formula. If an app is already present, the script skips it and moves on to the next one. This makes the script idempotent — you can run it as many times as you want without worrying about duplicate installations or wasted time reinstalling apps you already have.
As each application is processed, the script reports its status in real time. You see a clear indication of whether each app was successfully installed, was already present, or encountered an error during installation. Common errors include incorrect cask names, network connectivity issues, or insufficient disk space. When an error occurs, the script logs the details and continues with the remaining applications rather than stopping entirely.
At the end of the run, the script produces a summary report showing the total number of apps processed, how many were newly installed, how many were skipped because they were already present, and how many encountered errors. This summary is also written to the log file for future reference. The combination of real-time feedback and a final summary makes it easy to verify that everything was installed correctly.