diff --git a/fzf/install b/fzf/install index 8ecd8d5..a97ef7d 100755 --- a/fzf/install +++ b/fzf/install @@ -9,6 +9,7 @@ set -o pipefail source "../script/lib/utils" +use_brew brew install fzf info "Install fzf key bindings and completion…" diff --git a/homebrew/install b/homebrew/install index 85a1eb0..dc11220 100755 --- a/homebrew/install +++ b/homebrew/install @@ -13,11 +13,11 @@ source "$SCRIPT_DIR/../script/lib/utils" if ! command -v brew >/dev/null; then info "Install homebrew…" - /usr/bin/env bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + yes "" | INTERACTIVE=1 /usr/bin/env bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" if [ "$(uname -m)" = "arm64" ]; then info "Initialize homebrew shell…" - eval "$(/opt/homebrew/bin/brew shellenv)" + use_brew fi else info "Update homebrew…" diff --git a/script/lib/utils b/script/lib/utils index a947bcf..7c54efe 100644 --- a/script/lib/utils +++ b/script/lib/utils @@ -72,3 +72,7 @@ function create_symlinks() { symlink "$src" "$dest" done } + +function use_brew() { + eval "$(/opt/homebrew/bin/brew shellenv)" +} diff --git a/script/setup b/script/setup index 0585e7a..532cf2e 100755 --- a/script/setup +++ b/script/setup @@ -20,4 +20,7 @@ info "Set name to '$name'…" sudo scutil --set ComputerName "$name" sudo scutil --set LocalHostName "$name" +info "Create ~/.config directory if it does not exist…" +mkdir -p ~/.config + "$SCRIPT_DIR/install" diff --git a/zsh/install b/zsh/install index 24c51d8..2b535d2 100755 --- a/zsh/install +++ b/zsh/install @@ -9,6 +9,8 @@ set -o pipefail source "../script/lib/utils" +use_brew + HOMEBREW_ZSH="$(brew --prefix)/bin/zsh" readonly HOMEBREW_ZSH