This commit addresses two critical errors discovered during script execution:
1. **Fix Docker PATH loading issue**: The previous method of initializing the Homebrew environment was not consistently effective. This has been replaced with a more robust method that explicitly prepends the Homebrew bin and sbin directories to the `PATH` at the very beginning of the `.zshrc` file. This ensures that all Homebrew-installed commands, such as `docker`, are available before Oh My Zsh and its plugins are loaded.
2. **Fix `unbound variable` error in font script**: The `configure_terminal_font` function was rewritten to invoke `osascript` using a series of `-e` arguments instead of a heredoc. This change prevents the shell from misinterpreting the AppleScript code, resolving the `font_name?: unbound variable` error.
Introduces a new 'P' option in the main menu to update all installed Homebrew packages.
This is achieved by a new 'update_packages' function that runs 'brew upgrade'. This provides a convenient way for users to keep their development environment up-to-date directly from the script.
This commit addresses three separate issues identified during the execution of the vanity setup script:
1. **Handle existing fonts gracefully**: The `brew_ensure_cask` function is modified to catch the specific error that occurs when a font cask is installed but the font file already exists. Instead of failing, the script now reports the font as already present and continues.
2. **Fix Docker plugin load order**: The `install_zsh_config` function now prepends the `brew shellenv` command to the downloaded `.zshrc` file. This ensures the Homebrew PATH is set *before* Oh My Zsh loads its plugins, resolving the `command not found: docker` error on shell startup.
3. **Automatically update yt-dlp**: The `brew_ensure_formula` function is updated to automatically run `brew upgrade yt-dlp` if the formula is already installed. This keeps the tool up-to-date and prevents download failures (like HTTP 403 errors) caused by an outdated version.
Se modifica la función 'brew_ensure_cask' para detectar y omitir la instalación de casks de fuentes que ya existen en el sistema. Esto evita que el script se detenga con un error cuando una fuente ya está presente, lo que hace que el proceso de instalación sea más robusto.