Skip to content

Commit 8fe2803

Browse files
committed
feat: improve bootstrap, install process
1 parent 6430dd4 commit 8fe2803

File tree

8 files changed

+99
-146
lines changed

8 files changed

+99
-146
lines changed

brew/init_install.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
#-------------------------------------------------------------------------------
1515

1616
# shellcheck disable=SC1091
17-
[[ -z "$SHELLSUPPORT" ]] && \
18-
. "$( cd "${BASH_SOURCE%/*}/.." && pwd )/shell/support.sh"
17+
[[ -z "${SHELLSUPPORT:-}" ]] && {
18+
[[ -s "${DOTFILES:-"$HOME/.dotfiles"}/shell/response.sh" ]] \
19+
&& . "${DOTFILES:-"$HOME/.dotfiles"}/shell/response.sh"
20+
}
1921

2022
#-------------------------------------------------------------------------------
2123
# CONSTANTS
@@ -150,8 +152,8 @@ _set_homebrew_prefix () {
150152
if [[ "$OSTYPE" == "darwin"* ]]; then
151153
# macOS Intel
152154
HOMEBREW_PREFIX="/usr/local"
153-
[[ "$(sysctl -n machdep.cpu.brand_string)" =~ "Apple" ]] && \
154155
# Apple Silicon
156+
[[ "$(sysctl -n machdep.cpu.brand_string)" =~ "Apple" ]] && \
155157
HOMEBREW_PREFIX="/opt/homebrew"
156158
elif [[ "$OSTYPE" == "linux-gnu" ]]; then
157159
# Linux

brew/install.sh

Lines changed: 0 additions & 72 deletions
This file was deleted.

script/install

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,31 @@ for _file in $(find_files "$DOTFILES" 'install.sh' 2); do
1313
. "$_file"
1414
done
1515

16-
# Run before Ruby Gem installs
17-
# . "$DOTFILES/ruby/gem-update.sh"
18-
# Run after Ruby Gem installs
19-
# . "$DOTFILES/ruby/rehash.sh"
16+
# Homebrew installs
17+
if type "brew" &> /dev/null; then
18+
# Install deps/apps using Brewfile
19+
if [[ -r "$HOME/.Brewfile" ]]; then
20+
export HOMEBREW_BUNDLE_FILE="$HOME/.Brewfile"
21+
brew bundle install --global
22+
brew bundle check
23+
fi
24+
# Remove outdated versions from the cellar.
25+
brew cleanup
26+
fi
27+
28+
# Node.js/npm installs
29+
if type "npm" &> /dev/null; then
30+
npm install -g \
31+
cucumber \
32+
serverless \
33+
yo \
34+
;
35+
fi
36+
37+
# Ruby/Bundler installs
38+
if type "bundle" &> /dev/null && [[ -r "$HOME/.Gemfile" ]]; then
39+
(cd && bundle install --gemfile="$HOME/.Gemfile")
40+
fi
2041

2142
#-------------------------------------------------------------------------------
2243
# OS-specific Installs
@@ -55,33 +76,6 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
5576

5677
: # macOS (Darwin)
5778

58-
# Homebrew installs
59-
if type "brew" &> /dev/null; then
60-
# Install deps/apps using Brewfile
61-
if [[ -r "$HOME/.Brewfile" ]]; then
62-
export HOMEBREW_BUNDLE_FILE="$HOME/.Brewfile"
63-
brew bundle install --global
64-
brew bundle check
65-
fi
66-
# Remove outdated versions from the cellar.
67-
brew cleanup
68-
fi
69-
70-
# Node.js/npm installs
71-
if type "npm" &> /dev/null; then
72-
npm install -g \
73-
cucumber \
74-
less \
75-
serverless \
76-
yo \
77-
;
78-
fi
79-
80-
# Ruby/Bundler installs
81-
if type "bundle" &> /dev/null && [[ -r "$HOME/.Gemfile" ]]; then
82-
(cd && bundle install --gemfile="$HOME/.Gemfile")
83-
fi
84-
8579
# Set macOS defaults
8680
# This should only be run once Apps/Casks have been installed.
8781
[[ -s "$DOTFILES/macos/set-defaults.sh" ]] && . "$DOTFILES/macos/set-defaults.sh"

system/Brewfile.symlink

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ brew "wget", args: ["with-iri"]
6767
#
6868
# POPULAR BINARIES
6969
#
70-
brew "imagemagick" # [Image manipulation](https://www.imagemagick.org)
70+
# brew "imagemagick" # [Image manipulation](https://www.imagemagick.org)
7171
brew "pass" # [Password management](https://www.passwordstore.org/)
7272
brew "pv" # [Monitor progress via pipe](https://www.ivarch.com/programs/pv.shtml)
7373
brew "rename" # [Perl-powered file renamer](http://plasmasturm.org/code/rename)
@@ -104,6 +104,7 @@ brew "dive" # [Inspection of docker image layers](https://github.com/wagoodman/d
104104
# brew "elixir"
105105
# brew "erlang"
106106
# brew "galen"
107+
brew "go"
107108
brew "gradle"
108109
brew "helm"
109110
# brew "heroku"
@@ -141,8 +142,7 @@ brew "yq" # [lightweight YAML, JSON, XML processor](https://github.com/mikefarah
141142
cask "1password"
142143
cask "a-better-finder-rename"
143144
# cask "adobe-creative-cloud"
144-
# cask "adobe-photoshop-lightroom"
145-
# cask "adobe-reader"
145+
# cask "adobe-acrobat-reader"
146146
cask "alfred"
147147
# cask "atom"
148148
# cask "audacity"
@@ -158,7 +158,6 @@ cask "docker"
158158
# cask "evernote"
159159
# cask "filezilla"
160160
# cask "firefox"
161-
# cask "flash"
162161
cask "focusrite-control"
163162
# cask "gimp"
164163
cask "github"
@@ -242,7 +241,12 @@ cask "font-ubuntu"
242241
brew "mas"
243242
#
244243
# mas "1Password", id: 443987910
244+
mas "GarageBand", id: 682658836
245+
mas "iMovie", id: 408981434
246+
mas "Keynote", id: 409183694
245247
mas "Logic Pro", id: 634148309
248+
mas "Numbers", id: 409203825
249+
mas "Pages", id: 409201541
246250
#
247251
#-------------------------------------------------------------------------------
248252
# Whalebrew
@@ -251,14 +255,16 @@ mas "Logic Pro", id: 634148309
251255
#
252256
brew "whalebrew"
253257
#
258+
whalebrew "directory"
259+
#
254260
# @see https://github.com/whalebrew/whalebrew-packages
255261
# whalebrew "whalebrew/awscli"
256262
# whalebrew "whalebrew/awslogs"
257263
# whalebrew "whalebrew/azure-cli"
258-
# whalebrew "whalebrew/ffmpeg"
264+
whalebrew "whalebrew/ffmpeg"
259265
# whalebrew "whalebrew/helm"
260-
# whalebrew "whalebrew/graphviz"
261-
# whalebrew "whalebrew/imagemagick"
266+
whalebrew "whalebrew/graphviz"
267+
whalebrew "whalebrew/imagemagick"
262268
# whalebrew "whalebrew/kubectl"
263269
# whalebrew "whalebrew/kubeseal"
264270
# whalebrew "whalebrew/openshift-cli-v2"
@@ -295,8 +301,10 @@ vscode "mindaro.mindaro" # [Bridge to Kubernetes](https://marketplace.visualstud
295301
vscode "wmaurer.change-case" # [Change Case](https://marketplace.visualstudio.com/items?itemName=wmaurer.change-case)
296302
vscode "dlech.chmod" # [chmod](https://marketplace.visualstudio.com/items?itemName=dlech.chmod)
297303
vscode "formulahendry.code-runner" # [Code Runner](https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner)
304+
vscode "streetsidesoftware.code-spell-checker" # [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)
298305
vscode "lafe.contextualduplicate" # [Contextual Duplicate](https://marketplace.visualstudio.com/items?itemName=lafe.contextualduplicate)
299306
vscode "stevejpurves.cucumber" # [Cucumber (Gherkin) Syntax and Snippets](https://marketplace.visualstudio.com/items?itemName=stevejpurves.cucumber)
307+
vscode "nickgo.cuelang" # [Cuelang](https://marketplace.visualstudio.com/items?itemName=nickgo.cuelang)
300308
vscode "vscjava.vscode-java-debug" # [Debugger for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug)
301309
vscode "ms-vscode-remote.remote-containers" # [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
302310
vscode "ms-azuretools.vscode-docker" # [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker)
@@ -346,6 +354,7 @@ vscode "esbenp.prettier-vscode" # [Prettier - Code formatter](https://marketplac
346354
vscode "vscjava.vscode-java-dependency" # [Project Manager for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-dependency)
347355
vscode "ms-python.vscode-pylance" # [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance)
348356
vscode "ms-python.python" # [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
357+
vscode "ms-python.debugpy" # [Python Debugger](https://marketplace.visualstudio.com/items?itemName=ms-python.debugpy)
349358
vscode "mechatroner.rainbow-csv" # [Rainbow CSV](https://marketplace.visualstudio.com/items?itemName=mechatroner.rainbow-csv)
350359
vscode "jeppeandersen.raml" # [RAML](https://marketplace.visualstudio.com/items?itemName=jeppeandersen.raml)
351360
vscode "msjsdiag.vscode-react-native" # [React Native Tools](https://marketplace.visualstudio.com/items?itemName=msjsdiag.vscode-react-native)

system/Gemfile.symlink

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#!/usr/bin/env ruby
2+
#
3+
# shellcheck disable=SC1071,SC1091
4+
15
source 'https://rubygems.org'
26

37
# Gems here

zsh/install.sh

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,45 @@
33
# Install Zsh (Z shell)
44

55
# Shell Support
6-
# shellcheck disable=SC1090
6+
# shellcheck disable=SC1090,SC1091
77
[[ -z "$SHELLSUPPORT" ]] && . "$( cd "${BASH_SOURCE%/*}/.." && pwd )/shell/support.sh"
88

99
sh_info "Installing/updating Zshell + zsh-completions..."
1010
if type "brew" &> /dev/null; then
11-
# Install Zsh and Zsh completions
12-
brew install zsh zsh-completions
13-
# Install oh-my-zsh on top of zsh to getting additional functionality
14-
#curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
15-
# Add the new shell to the list of allowed shells
16-
if [ -e "$(brew --prefix)/bin/zsh" ]; then
17-
sh_info "Adding Zsh to your allowed shells (/etc/shells)..."
18-
if type "tee" &> /dev/null; then
19-
sudo tee -a /etc/shells <<<"$(brew --prefix)/bin/zsh"
20-
else
21-
sudo bash -c 'echo "$(brew --prefix)/bin/zsh" >> /etc/shells'
22-
fi
11+
# Install Zsh and Zsh completions
12+
brew install zsh zsh-completions
13+
# Install oh-my-zsh on top of zsh to getting additional functionality
14+
#curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
15+
# Add the new shell to the list of allowed shells
16+
if [ -e "$(brew --prefix)/bin/zsh" ]; then
17+
sh_info "Adding Zsh to your allowed shells (/etc/shells)..."
18+
if type "tee" &> /dev/null; then
19+
sudo tee -a /etc/shells <<<"$(brew --prefix)/bin/zsh"
20+
else
21+
sudo bash -c 'echo "$(brew --prefix)/bin/zsh" >> /etc/shells'
2322
fi
23+
fi
2424
elif type "apt-get" &> /dev/null; then
25-
sudo apt-get -y install zsh
25+
sudo apt-get -y install zsh
2626
elif type "yum" &> /dev/null; then
27-
sudo yum install zsh
27+
sudo yum install zsh
2828
fi
2929

3030
if type "zsh" &> /dev/null; then
31-
sh_success "$(zsh --version) installed: $(command -v zsh)"
32-
# Make Zsh your default shell.
33-
# This will not work if Zsh is not in your authorized shells list (/etc/shells).
34-
action=
35-
sh_yesno "Make Zsh your default shell?"
36-
read -r -n 1 action
37-
case "$action" in
38-
y )
39-
sh_info "Make Zsh your default shell..."
40-
sh_note "This will not work if Zsh is not in your authorized shells list (/etc/shells)."
41-
# chsh -s $(chsh -l | grep "zsh" -m 1)
42-
chsh -s "$(command -v zsh)"
43-
sh_alert "Restart your terminal to apply changes."
44-
;;
45-
esac
31+
sh_success "$(zsh --version) installed: $(command -v zsh)"
32+
# Make Zsh your default shell.
33+
# This will not work if Zsh is not in your authorized shells list (/etc/shells).
34+
action=
35+
sh_yesno "Make Zsh your default shell?"
36+
read -r -n 1 action
37+
case "$action" in
38+
y )
39+
sh_info "Make Zsh your default shell..."
40+
sh_note "This will not work if Zsh is not in your authorized shells list (/etc/shells)."
41+
chsh -s "$(brew --prefix)/bin/zsh"
42+
sh_alert "Restart your terminal to apply changes."
43+
;;
44+
esac
4645

47-
sh_note "Your active shell is: $SHELL"
46+
sh_note "Your active shell is: $SHELL"
4847
fi

zsh/zshenv.symlink

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,17 @@ fi
102102
# HOMEBREW INIT
103103
#-------------------------------------------------------------------------------
104104

105-
[[ -f "$DOTFILES/brew/init.sh" ]] && . "$DOTFILES/brew/init.sh"
105+
# [[ -f "$DOTFILES/brew/init_install.sh" ]] && . "$DOTFILES/brew/init_install.sh" \
106+
# && _init_homebrew
106107

107108
#-------------------------------------------------------------------------------
108109
# Load `.env` a.k.a. `~/.dotfiles/shell/env.symlink`
109110
#-------------------------------------------------------------------------------
110111
# This file should be loaded first in all shell environments,
111-
# in the following files; `~/.bashrc` and `~/.zshenv`
112+
# in the following files; `~/.bashrc` and `~/.zshenv`.
113+
# It is required in `~/.zshenv` so script-shell-env uses user bin/functions.
114+
# It is required a 2nd time, here in `~/.zshrc`, because `/etc/zprofile`
115+
# overwrites the PATH variable before `~/.zshrc` is executed. =(
112116

113117
[[ -f "${ZDOTDIR:-$HOME}/.env" ]] && . "${ZDOTDIR:-$HOME}/.env"
114118

zsh/zshrc.symlink

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ PATH="$PATH:$DEFAULT_PATH"
2626

2727
type "find_files" &> /dev/null || . "$DOTFILES/functions/find_files"
2828

29+
#-------------------------------------------------------------------------------
30+
# Load `.env` a.k.a. `~/.dotfiles/shell/env.symlink`
31+
#-------------------------------------------------------------------------------
32+
# This file should be loaded first in all shell environments,
33+
# in the following files; `~/.bashrc` and `~/.zshenv`.
34+
# It is required in `~/.zshenv` so script-shell-env uses user bin/functions.
35+
# It is required a 2nd time, here in `~/.zshrc`, because `/etc/zprofile`
36+
# overwrites the PATH variable before `~/.zshrc` is executed. =(
37+
38+
[[ -f "${ZDOTDIR:-$HOME}/.env" ]] && . "${ZDOTDIR:-$HOME}/.env"
39+
40+
2941
################################################################################
3042
################################################################################
3143
##
@@ -136,6 +148,7 @@ unsetopt CORRECT
136148
# This bunch of code displays red dots when autocompleting
137149
# a command with the tab key, "Oh-my-zsh"-style.
138150
expand-or-complete-with-dots() {
151+
# shellcheck disable=2028
139152
echo -n "\e[31m......\e[0m"
140153
zle expand-or-complete
141154
zle redisplay

0 commit comments

Comments
 (0)