diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2025-11-01 21:25:17 -0400 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2025-11-01 21:25:17 -0400 |
| commit | fe351483777c8d053d9f8b584278a4c2b162db0e (patch) | |
| tree | 15af9419e315bfad090c940be4a61625bf785876 /shlib/bootstrap.sh | |
| parent | Move /usr/local/bin farther up the path (diff) | |
| download | dotfiles-fe351483777c8d053d9f8b584278a4c2b162db0e.zip | |
Update install scripts for macos and linux and use sh
Diffstat (limited to 'shlib/bootstrap.sh')
| -rw-r--r-- | shlib/bootstrap.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/shlib/bootstrap.sh b/shlib/bootstrap.sh new file mode 100644 index 0000000..b2d6bb9 --- /dev/null +++ b/shlib/bootstrap.sh @@ -0,0 +1,29 @@ +# shellcheck shell=sh +[ -n "${DOTFILES_BOOTSTRAP_LOADED}" ] && return +readonly DOTFILES_BOOTSTRAP_LOADED=1 + +. "$(dirname "$0")/shlib/homebrew.sh" +. "$(dirname "$0")/shlib/log.sh" +. "$(dirname "$0")/shlib/prompt.sh" + +bootstrap_macos() { + if ! homebrew_is_installed; then + if prompt_for_confirmation "Homebrew not found. Would you like to install Homebrew?"; then + homebrew_install + else + log_error "Cannot continue without homebrew installed." + return 1 + fi + fi + + log_info "Found homebrew installation. Installing Brewfile.." + (cd homebrew && brew bundle) + log_info "Brewfile successfully installed. Moving to linking dotfiles.." + + sudo ln -sf "$HOME/bin/get-password" /usr/local/bin/get-password + sudo ln -sf "$(which op)" /usr/local/bin/op +} + +bootstrap_linux() { + return 0 +} |