feat: macos and brew install support
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Load .profile, containing login, non-bash related initializations.
|
||||
[ -f "$HOME/.profile" ] && source "$HOME/.profile"
|
||||
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
|
||||
0
files/home/.zshrc
Normal file
0
files/home/.zshrc
Normal file
@@ -31,10 +31,6 @@ function apt_installed {
|
||||
dpkg --status $1 >/dev/null
|
||||
}
|
||||
|
||||
function clean {
|
||||
sudo apt-get clean -qq
|
||||
}
|
||||
|
||||
function update {
|
||||
sudo apt-get update -qq
|
||||
}
|
||||
|
||||
@@ -9,4 +9,6 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
sw_vers
|
||||
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
lsb_release -a
|
||||
else
|
||||
echo "Unknown OS: $OSTYPE"
|
||||
fi
|
||||
|
||||
19
script/install.d/02-brew.sh
Executable file
19
script/install.d/02-brew.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Description:
|
||||
# (macOS only) Install homebrew.
|
||||
#
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
export NONINTERACTIVE=1
|
||||
if ! bin_in_path brew; then
|
||||
download_run https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh /bin/bash
|
||||
else
|
||||
brew update
|
||||
fi
|
||||
|
||||
brew --version
|
||||
|
||||
unset NONINTERACTIVE
|
||||
fi
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Description:
|
||||
# Install zsh shell.
|
||||
|
||||
|
||||
20
script/install.d/03-nerdfont.sh
Executable file
20
script/install.d/03-nerdfont.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Description:
|
||||
# (macOS only) Install nerdfonts.
|
||||
#
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
fonts_list=(
|
||||
font-fira-mono-nerd-font
|
||||
font-fira-code-nerd-font
|
||||
)
|
||||
|
||||
brew tap homebrew/cask-fonts
|
||||
for font in "${fonts_list[@]}"; do
|
||||
brew install --cask "$font"
|
||||
done
|
||||
|
||||
unset fonts_list
|
||||
fi
|
||||
14
script/install.d/04-zsh.sh
Executable file
14
script/install.d/04-zsh.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Description:
|
||||
# Configure zsh shell.
|
||||
#
|
||||
|
||||
if ! bin_in_path zsh; then
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
install zsh
|
||||
fi
|
||||
fi
|
||||
|
||||
zsh --version
|
||||
@@ -1,5 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Description:
|
||||
# Configure pyenv.
|
||||
#
|
||||
|
||||
if ! bin_in_path "pyenv"; then
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
# see https://github.com/pyenv/pyenv/wiki/common-build-problems
|
||||
pyenv_list_file="$INSTALL_DIR/10-pyenv-pkglist"
|
||||
install_file "$pyenv_list_file"
|
||||
@@ -8,14 +15,22 @@ if ! bin_in_path "pyenv"; then
|
||||
download_run \
|
||||
"https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer" \
|
||||
bash
|
||||
e
|
||||
unset pyenv_list_file
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
brew install pyenv
|
||||
brew install pyenv-virtualenv
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
virtualenv_path="$(pyenv root)/plugins/pyenv-virtualenv"
|
||||
if [ ! -d "$virtualenv_path" ]; then
|
||||
git clone \
|
||||
https://github.com/pyenv/pyenv-virtualenv.git \
|
||||
$virtualenv_path
|
||||
fi
|
||||
fi
|
||||
|
||||
eval "$(pyenv init --path)"
|
||||
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Description:
|
||||
# Configure Python.
|
||||
#
|
||||
|
||||
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
|
||||
|
||||
if ! bin_in_path "pip3"; then
|
||||
|
||||
@@ -1,22 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
nvm_version="v0.38.0"
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Description:
|
||||
# Configure Node.js.
|
||||
#
|
||||
|
||||
nvm_version="0.39.7"
|
||||
if ! bin_in_path "nvm"; then
|
||||
download_run "https://raw.githubusercontent.com/nvm-sh/nvm/${nvm_version}/install.sh" \
|
||||
download_run "https://raw.githubusercontent.com/nvm-sh/nvm/v${nvm_version}/install.sh" \
|
||||
"bash"
|
||||
fi
|
||||
|
||||
NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
|
||||
|
||||
nvm --version
|
||||
nvm alias default lts/fermium
|
||||
nvm install lts/fermium
|
||||
nvm use lts/fermium
|
||||
nvm alias default lts/iron
|
||||
nvm install lts/iron
|
||||
nvm use lts/iron
|
||||
|
||||
node --version
|
||||
|
||||
yarn --version
|
||||
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
for dep in $(jq -r ".node_dependencies[]" $CONFIG); do
|
||||
yarn global add $dep
|
||||
yarn global upgrade $dep
|
||||
done
|
||||
fi
|
||||
|
||||
unset nvm_version
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Description:
|
||||
# (Ubuntu only) Configure docker.
|
||||
#
|
||||
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
docker --version
|
||||
|
||||
readonly docker_group="docker"
|
||||
@@ -11,3 +18,6 @@ if ! groups "$USER" | grep -q "\b$docker_group\b"; then
|
||||
echo "Adding user to docker group"
|
||||
sudo usermod -aG docker "$USER"
|
||||
fi
|
||||
|
||||
unset docker_group
|
||||
fi
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
clean
|
||||
13
script/install.d/98-clean.sh
Executable file
13
script/install.d/98-clean.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Description:
|
||||
# Clean up after installation.
|
||||
#
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
brew cleanup
|
||||
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
sudo apt-get autoremove -qq
|
||||
sudo apt-get clean -qq
|
||||
fi
|
||||
@@ -1,2 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Description:
|
||||
# Print system information.
|
||||
#
|
||||
|
||||
screenfetch
|
||||
|
||||
Reference in New Issue
Block a user