107 lines
2.3 KiB
Bash
Executable File
107 lines
2.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# WARNING: Do not edit this file.
|
|
# It was generated by processing {{ yadm.source }}
|
|
|
|
set -eu
|
|
|
|
{% if yadm.os == "Darwin" %}
|
|
# install homebrew if it's missing
|
|
if ! command -v brew >/dev/null 2>&1; then
|
|
echo "Installing homebrew"
|
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
fi
|
|
|
|
if [ -f "$HOME/.Brewfile" ]; then
|
|
echo "Updating homebrew bundle"
|
|
brew bundle --global
|
|
fi
|
|
{% endif %}
|
|
|
|
{% if yadm.os == "Linux" %}
|
|
echo "installing git"
|
|
sudo apt-get install -y git
|
|
packages=()
|
|
packages+=(
|
|
"bat"
|
|
"boxes"
|
|
"catimg"
|
|
"duf"
|
|
"editorconfig"
|
|
"fdfind"
|
|
"figlet"
|
|
"fzf"
|
|
"gh"
|
|
#"git-delta" # this is a special case that will be handled seperately
|
|
"gnupg"
|
|
"gron"
|
|
#"gum" # this is a special case that will be handled seperately
|
|
"highlight"
|
|
# "hr" # may not be available
|
|
"htop"
|
|
"jq"
|
|
"lolcat"
|
|
"lsd"
|
|
"neovim"
|
|
#"nodejs" Using alternate install method
|
|
#"nvm" # will use install script
|
|
#"ots" # not available for debian?
|
|
"peco"
|
|
#"pngpaste" # no deb package
|
|
"pwgen"
|
|
"shellcheck"
|
|
#"slackcat" # no deb package
|
|
#"slackdump" # no deb package
|
|
#"tag" # no deb package
|
|
"thefuck"
|
|
"tldr"
|
|
"tmux"
|
|
"vim"
|
|
#"watch" # standard in debian
|
|
"wget"
|
|
"yadm"
|
|
"zoxide"
|
|
"zsh-autosuggestions"
|
|
"zsh-syntax-highlighting"
|
|
)
|
|
{% endif %}
|
|
|
|
# Directory to look for bootstrap executables in
|
|
BOOTSTRAP_D="${BASH_SOURCE[0]}.d"
|
|
|
|
if [[ ! -d "$BOOTSTRAP_D" ]]; then
|
|
echo "Error: bootstrap directory '$BOOTSTRAP_D' not found" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# This will execute all executable files (excluding templates and editor
|
|
# backups) in the $BOOTSTRAP_D directory when run.
|
|
|
|
find -L "$BOOTSTRAP_D" -type f | sort | while IFS= read -r bootstrap; do
|
|
if [[ -x "$bootstrap" && ! "$bootstrap" =~ "##" && ! "$bootstrap" =~ "~$" ]]; then
|
|
if ! "$bootstrap"; then
|
|
echo "Error: bootstrap '$bootstrap' failed" >&2
|
|
exit 1
|
|
fi
|
|
fi
|
|
done
|
|
|
|
hash -r
|
|
|
|
{% if yadm.os == "Linux" %}
|
|
npm install --global pure-prompt
|
|
{% endif %}
|
|
|
|
{% if yadm.class == "Work" %}
|
|
YARN=$(brew --prefix yarn)/bin/yarn
|
|
|
|
if (command -v "$YARN" >/dev/null 2>&1); then
|
|
# Install yalc. Needed for local-publish
|
|
echo "Installing yalc..."
|
|
if ! $YARN global add yalc; then
|
|
echo "Failed to install yalc" >&2
|
|
else
|
|
echo "Successfully installed yalc"
|
|
fi
|
|
fi
|
|
{% endif %}
|