+#!/bin/bash
# For installing from the extracted package tmp directory
-pkg_install() {
+function pkg_install() {
pushd "$WEBI_TMP" 2>&1 > /dev/null
if [ -n "$(command -v rsync 2> /dev/null | grep rsync)" ]; then
-{
+#!/bin/bash
+function __init_arc() {
set -e
set -u
echo "$(arc version 2> /dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
}
}
+
+__init_arc
+#!/bin/bash
# title: Archiver (arc alias)
# homepage: https://webinstall.dev/arc
# tagline: Alias for https://webinstall.dev/arc
# IMPORTANT: this let's other functions know to expect this to be a single file
WEBI_SINGLE=true
-pkg_get_current_version() {
+function pkg_get_current_version() {
# 'awless version' has output in this format:
# v2.1.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
# This trims it down to just the version number:
echo "$(awless version 2> /dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')"
}
-pkg_install() {
+function pkg_install() {
# $HOME/.local/opt/awless-v2.1.0/bin
mkdir -p "$pkg_src_bin"
chmod a+x "$pkg_src_cmd"
}
-pkg_link() {
+function pkg_link() {
# rm -f "$HOME/.local/bin/awless"
rm -f "$pkg_dst_cmd"
#!/bin/bash
-{
+function __init_bat() {
set -e
set -u
chmod a+x "$pkg_src_cmd"
}
}
+
+__init_bat
# IMPORTANT: this let's other functions know to expect this to be a single file
WEBI_SINGLE=true
-pkg_get_current_version() {
+function pkg_get_current_version() {
# 'caddy version' has output in this format:
# v2.1.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
# This trims it down to just the version number:
echo "$(caddy version 2> /dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')"
}
-pkg_install() {
+function pkg_install() {
# $HOME/.local/opt/caddy-v2.1.0/bin
mkdir -p "$pkg_src_bin"
chmod a+x "$pkg_src_cmd"
}
-pkg_link() {
+function pkg_link() {
# rm -f "$HOME/.local/bin/caddy"
rm -f "$pkg_dst_cmd"
#!/bin/bash
-{
+function __init_chromedriver() {
set -e
set -u
}
}
+
+__init_chromedriver
#!/bin/bash
-{
+function __init_comrak() {
set -e
set -u
"$pkg_src_cmd" --version > /dev/null
}
}
+
+__init_comrak
#!/bin/bash
-{
+function __init_curlie() {
set -e
set -u
chmod a+x "$pkg_src_cmd"
}
}
+
+__init_curlie
# IMPORTANT: this let's other functions know to expect this to be a single file
WEBI_SINGLE=true
-pkg_get_current_version() {
+function pkg_get_current_version() {
# 'deno --version' has output in this format:
# deno 1.1.0
# v8 8.4.300
echo "$(deno --version 2> /dev/null | head -n 1 | cut -d' ' -f2)"
}
-pkg_install() {
+function pkg_install() {
# $HOME/.local/xbin
mkdir -p "$pkg_src_bin"
chmod a+x "$pkg_src_cmd"
}
-pkg_link() {
+function pkg_link() {
# rm -f "$HOME/.local/bin/deno"
rm -f "$pkg_dst_cmd"
#!/bin/bash
-{
+function __dotenv_linter() {
set -e
set -u
}
}
+
+__dotenv_linter
#!/bin/bash
-{
+function __init_fd() {
set -e
set -u
chmod a+x "$pkg_src_cmd"
}
}
+
+__init_fd
#!/bin/bash
-{
+function __init_ffmpeg() {
set -e
set -u
}
}
+
+__init_ffmpeg
pkg_src_dir="$HOME/.local/opt/flutter-v$WEBI_VERSION"
pkg_src="$pkg_src_dir"
-pkg_get_current_version() {
+function pkg_get_current_version() {
# 'flutter --version' outputs a lot of information:
# Flutter 1.19.0-4.1.pre • channel beta • https://github.com/flutter/flutter.git
# Framework • revision f994b76974 (4 days ago) • 2020-06-09 15:53:13 -0700
echo "$(flutter --version 2> /dev/null | head -n 1 | cut -d' ' -f2)"
}
-pkg_format_cmd_version() {
+function pkg_format_cmd_version() {
# 'flutter 1.19.0' is the canonical version format for flutter
my_version="$1"
echo "$pkg_cmd_name $my_version"
#!/bin/bash
-{
+function __init_fzf() {
set -e
set -u
chmod a+x "$pkg_src_cmd"
}
}
+
+__init_fzf
set -e
set -u
-export PATH="$HOME/.local/opt/gnupg/bin:$PATH"
-export PATH="$HOME/.local/opt/gnupg/bin/pinentry-mac.app/Contents/MacOS:$PATH"
+function __git_gpg_init() {
+ export PATH="$HOME/.local/opt/gnupg/bin:$PATH"
+ export PATH="$HOME/.local/opt/gnupg/bin/pinentry-mac.app/Contents/MacOS:$PATH"
-# TODO check for public key without gpg-pubkey?
-if ! command -v gpg-pubkey; then
- webi gpg-pubkey
-else
- gpg-pubkey
-fi
+ # TODO check for public key without gpg-pubkey?
+ if ! command -v gpg-pubkey; then
+ webi gpg-pubkey
+ else
+ gpg-pubkey
+ fi
-MY_KEY_ID="$(
- gpg-pubkey-id
-)"
+ MY_KEY_ID="$(
+ gpg-pubkey-id
+ )"
-echo -n "Enabling automatic git commit signing...
- git config --global user.signingkey ${MY_KEY_ID}
+ echo -n "Enabling automatic git commit signing...
+ git config --global user.signingkey ${MY_KEY_ID}
+ git config --global commit.gpgsign true
+ git config --global log.showSignature true
+ "
+
+ git config --global user.signingkey "${MY_KEY_ID}"
git config --global commit.gpgsign true
git config --global log.showSignature true
-"
-git config --global user.signingkey "${MY_KEY_ID}"
-git config --global commit.gpgsign true
-git config --global log.showSignature true
+ echo ""
+ echo "Successfully updated ~/.gitconfig"
+ echo ""
+ echo "How to verify signed commits on GitHub:"
+ echo ""
+ echo " 1. Go to 'Add GPG Key': https://github.com/settings/gpg/new"
+ echo " 2. Copy and paste the key above from the first ---- to the last ----"
+ echo ""
+}
-echo ""
-echo "Successfully updated ~/.gitconfig"
-echo ""
-echo "How to verify signed commits on GitHub:"
-echo ""
-echo " 1. Go to 'Add GPG Key': https://github.com/settings/gpg/new"
-echo " 2. Copy and paste the key above from the first ---- to the last ----"
-echo ""
+__git_gpg_init
+#!/bin/bash
set -e
set -u
pkg_src_cmd="$HOME/.local/opt/gitea-v$WEBI_VERSION/gitea"
pkg_dst_cmd="$HOME/.local/opt/gitea/gitea"
-pkg_get_current_version() {
+function pkg_get_current_version() {
# 'gitea version' has output in this format:
# v2.1.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
# This trims it down to just the version number:
echo "$(gitea --version 2> /dev/null | head -n 1 | cut -d' ' -f3)"
}
-pkg_link() {
+function pkg_link() {
# although gitea is a single command it must be put in its own directory
# because it will always resolve its working path to its location,
# regardless of where it was started, where its config file lives, etc.
}
# For installing from the extracted package tmp directory
-pkg_install() {
+function pkg_install() {
# remove the versioned folder, just in case it's there with junk
rm -rf "$pkg_src_bin"
mkdir -p "$pkg_src_bin"
+#!/bin/bash
# title: GnuPG (gpg alias)
# homepage: https://webinstall.dev/gpg
# tagline: Alias for https://webinstall.dev/gpg
+#!/bin/bash
# title: Go (golang alias)
# homepage: https://webinstall.dev/golang
# tagline: Alias for https://webinstall.dev/golang
#
# Their defaults are defined in _webi/template.sh at https://github.com/webinstall/packages
-pkg_get_current_version() {
+function pkg_get_current_version() {
# 'go version' has output in this format:
# go version go1.14.2 darwin/amd64
# This trims it down to just the version number:
sed 's:go::'
}
-pkg_format_cmd_version() {
+function pkg_format_cmd_version() {
# 'go v1.14.0' will be 'go1.14'
my_version=$(echo "$1" | sed 's:\.0::g')
echo "${pkg_cmd_name}${my_version}"
}
-pkg_link() {
+function pkg_link() {
# 'pkg_dst' will default to $HOME/.local/opt/go
# 'pkg_src' will be the installed version, such as to $HOME/.local/opt/go-v1.14.2
rm -rf "$pkg_dst"
ln -s "$GOBIN_REAL" "$GOBIN"
}
-pkg_post_install() {
+function pkg_post_install() {
pkg_link
# web_path_add is defined in _webi/template.sh at https://github.com/webinstall/packages
echo ""
}
-pkg_done_message() {
+function pkg_done_message() {
echo "Installed 'go v$WEBI_VERSION' to ~/.local/opt/go"
# note: literal $HOME on purpose
#shellcheck disable=SC2016
#!/bin/bash
-{
+function __init_goreleaser() {
set -e
set -u
}
}
+
+__init_goreleaser
#!/bin/bash
-{
+function __init_gprox() {
set -e
set -u
echo $(gprox --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
+
+__init_gprox
#!/bin/bash
-{
+function __init_hexyl() {
set -e
set -u
chmod a+x "$pkg_src_cmd"
}
}
+
+__init_hexyl
+#!/bin/bash
set -e
set -u
pkg_cmd_name="hugo"
WEBI_SINGLE=true
-pkg_get_current_version() {
+function pkg_get_current_version() {
# 'hugo version' has output in this format:
# Hugo Static Site Generator v0.72.0-8A7EF3CF darwin/amd64 BuildDate: 2020-05-31T12:07:44Z
# This trims it down to just the version number:
+#!/bin/bash
# title: iterm-utils (iterm2-utils alias)
# homepage: https://webinstall.dev/iterm2-utils
# tagline: Alias for https://webinstall.dev/iterm2-utils
+#!/bin/bash
# title: iTerm (iTerm2 alias)
# homepage: https://webinstall.dev/iterm2
# tagline: Alias for https://webinstall.dev/iterm2
#!/bin/bash
-{
+function __init_jq() {
set -e
set -u
echo $(jq --version 2> /dev/null | head -n 1 | sed 's:^jq-::')
}
}
+
+__init_jq
#!/bin/bash
-{
+function __init_k9s() {
set -e
set -u
}
}
+
+__init_k9s
}
pkg_get_current_version() {
- echo $(kind --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+ echo $(kind --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
#!/bin/bash
-{
+function __init_kubectx() {
set -e
set -u
}
}
+
+__init_kubectx
#!/bin/bash
-{
+function __init_kubens() {
set -e
set -u
}
}
+
+__init_kubens
#!/bin/bash
-{
+function __init_lsd() {
set -e
set -u
}
}
+
+__init_lsd
#!/bin/bash
-{
+function __init_myip() {
set -e
set -u
"$HOME/.local/bin/myip"
}
+
+__init_myip
+#!/bin/bash
# title: nerd-font (nerdfont alias)
# homepage: https://webinstall.dev/nerdfont
# tagline: Alias for https://webinstall.dev/nerdfont
+#!/bin/bash
# title: nerd-fonts (nerdfont alias)
# homepage: https://webinstall.dev/nerdfont
# tagline: Alias for https://webinstall.dev/nerdfont
-install() {
+#!/bin/bash
+
+function __init_nerdfont() {
set -e
set -u
echo "Installed $my_nerdfont to ~/$my_fontdir"
}
-install
+__init_nerdfont
+#!/bin/bash
# title: nerd-fonts (nerdfont alias)
# homepage: https://webinstall.dev/nerdfont
# tagline: Alias for https://webinstall.dev/nerdfont
pkg_cmd_name="node"
#WEBI_SINGLE=""
-pkg_get_current_version() {
+function pkg_get_current_version() {
# 'node --version' has output in this format:
# v12.8.0
# This trims it down to just the version number:
sed 's:^v::'
}
-pkg_install() {
+function pkg_install() {
# mkdir -p $HOME/.local/opt
mkdir -p "$(dirname $pkg_src)"
mv ./"$pkg_cmd_name"* "$pkg_src"
}
-pkg_link() {
+function pkg_link() {
# rm -f "$HOME/.local/opt/node"
rm -f "$pkg_dst"
"$pkg_src"/bin/node "$pkg_src"/bin/npm config set scripts-prepend-node-path=true
}
-pkg_done_message() {
+function pkg_done_message() {
echo "Installed 'node' and 'npm' at $pkg_dst"
}
-{
+#!/bin/bash
+function __init_pandoc{
set -e
set -u
echo $(pandoc --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
+
+__init_pandoc
pkg_cmd_name="pathman"
WEBI_SINGLE=true
-pkg_get_current_version() {
+function pkg_get_current_version() {
echo $(pathman version 2> /dev/null | head -n 1 | cut -d ' ' -f2 | sed 's:^v::')
}
-pkg_done_message() {
+function pkg_done_message() {
# no message
true
}
+#!/bin/bash
+
set -e
set -u
POSTGRES_DATA_DIR=$HOME/.local/share/postgres/var
-pkg_get_current_version() {
+function pkg_get_current_version() {
# 'postgres --version' has output in this format:
# postgres (PostgreSQL) 10.13
# This trims it down to just the version number:
echo "$(postgres --version 2> /dev/null | head -n 1 | cut -d' ' -f3)"
}
-pkg_install() {
+function pkg_install() {
# mkdir -p $HOME/.local/opt
mkdir -p "$(dirname $pkg_src)"
mv ./"p"* "$pkg_src"
}
-pkg_link() {
+function pkg_link() {
# rm -f "$HOME/.local/opt/postgres"
rm -f "$pkg_dst"
rm -f "$HOME/Applications/pgAdmin"*.app || true
ln -s "$pkg_src/pgAdmin 4.app" "$HOME/Applications/pgAdmin 4.app" || true
}
-pkg_post_install() {
+function pkg_post_install() {
webi_path_add "$pkg_dst_bin"
#echo "Initializing PostgreSQL with database at $POSTGRES_DATA_DIR/"
fi
}
-pkg_done_message() {
+function pkg_done_message() {
# TODO show with serviceman
echo "Installed 'postgres' and 'psql' at $pkg_dst"
echo ""
+#!/bin/bash
# title: PostgreSQL (Postgres alias)
# homepage: https://webinstall.dev/postgres
# tagline: Alias for https://webinstall.dev/postgres
#!/bin/bash
-{
+function __init_powershell() {
set -e
set -u
echo "Installed 'pwsh' at $pkg_dst"
}
}
+
+__init_powershell
#!/bin/bash
-if [ -z "$(npm --version 2> /dev/null)" ]; then
- webi node
- export PATH="$HOME/.local/opt/node/bin:$PATH"
-fi
-npm install -g prettier@latest
+function __init_prettier() {
+ if [ -z "$(npm --version 2> /dev/null)" ]; then
+ webi node
+ export PATH="$HOME/.local/opt/node/bin:$PATH"
+ fi
+ npm install -g prettier@latest
+}
+
+__init_prettier
+#!/bin/bash
# title: PowerShell (pwsh alias)
# homepage: https://webinstall.dev/powershell
# tagline: Alias for https://webinstall.dev/powershell
set -e
set -u
-function __install_rg() {
+function __init_rg() {
###################
# Install ripgrep #
}
}
-__install_rg
+__init_rg
+#!/bin/bash
# title: Ripgrep (alias)
# homepage: https://webinstall.dev/rg
# tagline: `ripgrep` (project) is an alias for `rg` (command)
+#!/bin/bash
# title: Rust (rustlang alias)
# homepage: https://webinstall.dev/rustlang
# tagline: Alias for https://webinstall.dev/rustlang
#!/bin/bash
-{
+function __init_sd() {
set -e
set -u
}
}
+
+__init_sd
#!/bin/bash
-{
+function __init_shfmt() {
set -e
set -u
}
}
+
+__init_shfmt
-{
+#!/bin/bash
+
+function __init_ssh_utils() {
rm -f "$HOME/.local/bin/ssh-pubkey" "$HOME/.local/bin/ssh-setpass" "$HOME/.local/bin/ssh-adduser"
webi_download "$WEBI_HOST/packages/ssh-utils/ssh-pubkey.sh" "$HOME/.local/bin/ssh-pubkey"
webi_download "$WEBI_HOST/packages/ssh-utils/ssh-setpass.sh" "$HOME/.local/bin/ssh-setpass"
webi_download "$WEBI_HOST/packages/ssh-utils/ssh-adduser.sh" "$HOME/.local/bin/ssh-adduser"
chmod a+x "$HOME/.local/bin/ssh-"*
}
+
+__init_ssh_utils
#!/bin/bash
-{
+function __init_ssh_setpass() {
set -e
set -u
ssh-keygen -p -f "$HOME/.ssh/id_rsa"
}
+
+__init_ssh_setpass
+#!/bin/bash
+
set -e
set -u
-{
+function __init_sudo() {
if [ -z "$(command -v sudo)" ]; then
echo >&2 "Error: on Linux and BSD you should install sudo via the native package manager"
fi
}
+
+__init_sudo
-# mostly lightweight, or essential
-webi \
- vim-leader \
- vim-shell \
- vim-sensible \
- vim-viminfo \
- vim-lastplace \
- vim-spell \
- vim-ale \
- vim-prettier \
- vim-whitespace
+#!/bin/bash
-# requires special hardware (mouse) or software (nerdfont)
-webi \
- vim-gui \
- vim-nerdtree \
- nerdfont \
- vim-devicons
+function __init_vim_beyondcode() {
+ # mostly lightweight, or essential
+ webi \
+ vim-leader \
+ vim-shell \
+ vim-sensible \
+ vim-viminfo \
+ vim-lastplace \
+ vim-spell \
+ vim-ale \
+ vim-prettier \
+ vim-whitespace
-if [ -n "$(command -v go)" ]; then
- webi vim-go
-fi
+ # requires special hardware (mouse) or software (nerdfont)
+ webi \
+ vim-gui \
+ vim-nerdtree \
+ nerdfont \
+ vim-devicons
-# done
+ if [ -n "$(command -v go)" ]; then
+ webi vim-go
+ fi
+ # done
+}
+
+__init_vim_beyondcode
-webi \
- vim-leader \
- vim-shell \
- vim-sensible \
- vim-viminfo \
- vim-lastplace \
- vim-spell \
- vim-ale \
- vim-prettier \
- vim-whitespace
-# done
+#!/bin/bash
-printf '\n'
-printf 'Suggestion: Also check out these great plugins:\n'
-printf '\n'
-printf ' - vim-nerdtree (better than the default file browser)\n'
-printf ' - vim-gui (mouse & clipboard support)\n'
-printf ' - vim-devicons (use nerdfont icons in vim)\n'
-printf '\n'
-printf ' - vim-go (golang linting, etc)\n'
-printf ' - vim-rust (rustlang linting, etc)\n'
-printf '\n'
+function __init_vim_essentials() {
+ webi \
+ vim-leader \
+ vim-shell \
+ vim-sensible \
+ vim-viminfo \
+ vim-lastplace \
+ vim-spell \
+ vim-ale \
+ vim-prettier \
+ vim-whitespace
+ # done
+
+ printf '\n'
+ printf 'Suggestion: Also check out these great plugins:\n'
+ printf '\n'
+ printf ' - vim-nerdtree (better than the default file browser)\n'
+ printf ' - vim-gui (mouse & clipboard support)\n'
+ printf ' - vim-devicons (use nerdfont icons in vim)\n'
+ printf '\n'
+ printf ' - vim-go (golang linting, etc)\n'
+ printf ' - vim-rust (rustlang linting, etc)\n'
+ printf '\n'
+}
+
+__init_vim_essentials
#!/bin/bash
-{
+function __init_vps_addswap() {
set -e
set -u
# Cause swap to be activated on boot
echo '/var/swapfile none swap sw 0 0' | tee -a /etc/fstab
}
+
+__init_vps_addswap "$@"
#!/bin/bash
-{
+function __init_vps_utils() {
set -e
set -u
chmod a+x "$HOME/.local/bin/myip"
chmod a+x "$HOME/.local/bin/vps-"*
}
+
+__init_vps_utils
#!/bin/bash
-{
+function __init_watchexec() {
set -e
set -u
}
}
+
+__init_watchexec
#!/bin/bash
-{
+function __init_xz() {
set -e
set -u
echo $(xz --version 2> /dev/null | head -n 1 | cut -d ' ' -f 4)
}
}
+
+__init_xz
#!/bin/bash
-{
+function __init_yq() {
set -e
set -u
}
}
+
+__init_yq
# zoxide v0.5.0-31-g8452961
# This trims it down to just the version number:
# 0.5.0
- zoxide --version 2>/dev/null | head -n 1 | cut -d '-' -f 1 | cut -b '9-'
+ zoxide --version 2> /dev/null | head -n 1 | cut -d '-' -f 1 | cut -b '9-'
}
# shellcheck disable=SC2016