Skip to content

Latest commit

 

History

History
executable file
·
32 lines (23 loc) · 5.21 KB

File metadata and controls

executable file
·
32 lines (23 loc) · 5.21 KB

sync-Brew.sh (Analyzed with deepseek-coder:latest)

Analysis Date: 2025-04-29 00:16:56

Overview The script is designed to sync Homebrew with a Brewfile. It's used for managing brew installations in the cloud and locally (like iCloud Drive). This ensures that all of your installed formulae, casks & versions are consistent across different machines. Here it serves as an alias so you can just run ./sync-Brew instead of having to type out each command from scratch every time when managing a new project or adding dependencies for the first time in any environment where Homebrew is used by default (e.g., git bash, VS Code Terminal).

Requirements This script requires that you have homebrew installed on your system and access to it via zsh shell program as well which will be a requirement if this script was intended for use in an environment with different user's default terminal or command line interface. Additionally, the Brewfile should also exist at specified path ("/Users/ian...").

Usage
To run sync-brew on your system you need to first make sure that Brew is installed and have access for ZSH shell program in order of following:

  1. Change default terminal or CLI tool. You can use chsh -s /bin/zsh command if it's already set, otherwise try the next point; 2) Install Homebrew using Command Line Tools by running 'xcode-select --install'. After confirming that these prerequisites are fulfilled install and run sync script via your terminal with ./sync-Brew.sh ```shellscript in Terminal (for MacOS). Make sure to replace the path "Users/ian..." as per yours if it's not set correctly, you can use 'cd /.dotfiles && ./install', but this is only for Unix environments like Linux and macOS that have ~.dotfile directory structure'. ```shellscript will run a script to setup brew bundle via Homebrew which requires access from the system since it uses ZSH shell program under its hood, following command line instructions: 'export HOMEBREW_BREWFILE="/Users/ian/Library/Mobile Documents/comapple~CloudDocs/Brewfile/Brewfile" and then brew bundle' should be run in Terminal. shellscript` to setup these prerequisites; 3) You can add the script file location path into your system’s PATH environment variable with 'echo $PATH', if it is not included, you might need a shell configuration like this: `vim ~/.bashrc echo "export PATH=\"\$HOME/.local/bin:\$PATH" >> ~/.bashrc' (for bash file) and then source ~/.bashrc. shellscriptIn addition to these steps the script will also install some casks via Homebrew, which you can specify in your Brewfile or manually if needed by following 'Brew Casks section'. For details on how this setup works for new projects refersync-Brew file description above. ```shellscriptand follow instructions within each step of operation to understand what it does before running the script again with respective parameters as per your needs, use appropriate flags or switches (like -f --force) if needed during usage steps in detail manner at https://docs.brew.sh/Homebrew-Bundler for more detailed info on this point and how you can run brew bundle manually via CLI before running the script again by./sync_file` command from terminal,
```shellscript` Finally do keep an eye on `./sync- Brew.sh --help' at command line terminal while using the script for more info about how you can run this shell scripts and its parameters: https://docs.brew.sh/Homebrew-Bundler  . This README file will provide a comprehensive description of what each section contains, from usage to disclaimer as well ensuring that your system is properly configured with all the necessary tools for managing Brewfile using scripting in MacOS or Linux environment by any other user who has similar needs.

### License
This script is provided under the MIT License.

MIT License

Copyright (c) 2025 Ian Trimble

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.