mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-02-14 17:49:53 +00:00
chore(style): convert blocks into functions (see #325)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/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
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
#!/bin/bash
|
||||
function __init_arc() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -34,3 +35,5 @@
|
||||
echo "$(arc version 2> /dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
|
||||
}
|
||||
}
|
||||
|
||||
__init_arc
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# title: Archiver (arc alias)
|
||||
# homepage: https://webinstall.dev/arc
|
||||
# tagline: Alias for https://webinstall.dev/arc
|
||||
|
||||
@@ -14,7 +14,7 @@ pkg_cmd_name="awless"
|
||||
# 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:
|
||||
@@ -22,7 +22,7 @@ pkg_get_current_version() {
|
||||
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"
|
||||
|
||||
@@ -33,7 +33,7 @@ pkg_install() {
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
|
||||
pkg_link() {
|
||||
function pkg_link() {
|
||||
# rm -f "$HOME/.local/bin/awless"
|
||||
rm -f "$pkg_dst_cmd"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_bat() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -29,3 +29,5 @@
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
}
|
||||
|
||||
__init_bat
|
||||
|
||||
@@ -14,7 +14,7 @@ pkg_cmd_name="caddy"
|
||||
# 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:
|
||||
@@ -22,7 +22,7 @@ pkg_get_current_version() {
|
||||
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"
|
||||
|
||||
@@ -33,7 +33,7 @@ pkg_install() {
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
|
||||
pkg_link() {
|
||||
function pkg_link() {
|
||||
# rm -f "$HOME/.local/bin/caddy"
|
||||
rm -f "$pkg_dst_cmd"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_chromedriver() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -37,3 +37,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__init_chromedriver
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_comrak() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -34,3 +34,5 @@
|
||||
"$pkg_src_cmd" --version > /dev/null
|
||||
}
|
||||
}
|
||||
|
||||
__init_comrak
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_curlie() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -31,3 +31,5 @@
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
}
|
||||
|
||||
__init_curlie
|
||||
|
||||
@@ -12,7 +12,7 @@ pkg_cmd_name="deno"
|
||||
# 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
|
||||
@@ -22,7 +22,7 @@ pkg_get_current_version() {
|
||||
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"
|
||||
|
||||
@@ -33,7 +33,7 @@ pkg_install() {
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
|
||||
pkg_link() {
|
||||
function pkg_link() {
|
||||
# rm -f "$HOME/.local/bin/deno"
|
||||
rm -f "$pkg_dst_cmd"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __dotenv_linter() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -37,3 +37,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__dotenv_linter
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_fd() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -29,3 +29,5 @@
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
}
|
||||
|
||||
__init_fd
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_ffmpeg() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -39,3 +39,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__init_ffmpeg
|
||||
|
||||
@@ -21,7 +21,7 @@ pkg_src_cmd="$HOME/.local/opt/flutter-v$WEBI_VERSION/bin/flutter"
|
||||
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
|
||||
@@ -32,7 +32,7 @@ pkg_get_current_version() {
|
||||
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"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_fzf() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -29,3 +29,5 @@
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
}
|
||||
|
||||
__init_fzf
|
||||
|
||||
@@ -2,35 +2,39 @@
|
||||
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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -5,7 +6,7 @@ pkg_cmd_name="gitea"
|
||||
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:
|
||||
@@ -13,7 +14,7 @@ pkg_get_current_version() {
|
||||
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.
|
||||
@@ -24,7 +25,7 @@ pkg_link() {
|
||||
}
|
||||
|
||||
# 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"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# title: GnuPG (gpg alias)
|
||||
# homepage: https://webinstall.dev/gpg
|
||||
# tagline: Alias for https://webinstall.dev/gpg
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# title: Go (golang alias)
|
||||
# homepage: https://webinstall.dev/golang
|
||||
# tagline: Alias for https://webinstall.dev/golang
|
||||
|
||||
@@ -15,7 +15,7 @@ pkg_cmd_name="go"
|
||||
#
|
||||
# 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:
|
||||
@@ -26,13 +26,13 @@ pkg_get_current_version() {
|
||||
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"
|
||||
@@ -47,7 +47,7 @@ pkg_link() {
|
||||
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
|
||||
@@ -108,7 +108,7 @@ pkg_post_install() {
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_goreleaser() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -37,3 +37,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__init_goreleaser
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_gprox() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -27,3 +27,5 @@
|
||||
echo $(gprox --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
|
||||
}
|
||||
}
|
||||
|
||||
__init_gprox
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_hexyl() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -29,3 +29,5 @@
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
}
|
||||
|
||||
__init_hexyl
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#!/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:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# title: iterm-utils (iterm2-utils alias)
|
||||
# homepage: https://webinstall.dev/iterm2-utils
|
||||
# tagline: Alias for https://webinstall.dev/iterm2-utils
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# title: iTerm (iTerm2 alias)
|
||||
# homepage: https://webinstall.dev/iterm2
|
||||
# tagline: Alias for https://webinstall.dev/iterm2
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_jq() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -18,3 +18,5 @@
|
||||
echo $(jq --version 2> /dev/null | head -n 1 | sed 's:^jq-::')
|
||||
}
|
||||
}
|
||||
|
||||
__init_jq
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_k9s() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -41,3 +41,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__init_k9s
|
||||
|
||||
@@ -23,7 +23,7 @@ function __init_kind() {
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_kubectx() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -34,3 +34,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__init_kubectx
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_kubens() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -34,3 +34,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__init_kubens
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_lsd() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -37,3 +37,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__init_lsd
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_myip() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -10,3 +10,5 @@
|
||||
|
||||
"$HOME/.local/bin/myip"
|
||||
}
|
||||
|
||||
__init_myip
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# title: nerd-font (nerdfont alias)
|
||||
# homepage: https://webinstall.dev/nerdfont
|
||||
# tagline: Alias for https://webinstall.dev/nerdfont
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# title: nerd-fonts (nerdfont alias)
|
||||
# homepage: https://webinstall.dev/nerdfont
|
||||
# tagline: Alias for https://webinstall.dev/nerdfont
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
install() {
|
||||
#!/bin/bash
|
||||
|
||||
function __init_nerdfont() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -21,4 +23,4 @@ install() {
|
||||
echo "Installed $my_nerdfont to ~/$my_fontdir"
|
||||
}
|
||||
|
||||
install
|
||||
__init_nerdfont
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# title: nerd-fonts (nerdfont alias)
|
||||
# homepage: https://webinstall.dev/nerdfont
|
||||
# tagline: Alias for https://webinstall.dev/nerdfont
|
||||
|
||||
@@ -12,7 +12,7 @@ set -u
|
||||
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:
|
||||
@@ -23,7 +23,7 @@ pkg_get_current_version() {
|
||||
sed 's:^v::'
|
||||
}
|
||||
|
||||
pkg_install() {
|
||||
function pkg_install() {
|
||||
# mkdir -p $HOME/.local/opt
|
||||
mkdir -p "$(dirname $pkg_src)"
|
||||
|
||||
@@ -31,7 +31,7 @@ pkg_install() {
|
||||
mv ./"$pkg_cmd_name"* "$pkg_src"
|
||||
}
|
||||
|
||||
pkg_link() {
|
||||
function pkg_link() {
|
||||
# rm -f "$HOME/.local/opt/node"
|
||||
rm -f "$pkg_dst"
|
||||
|
||||
@@ -42,6 +42,6 @@ pkg_link() {
|
||||
"$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"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
#!/bin/bash
|
||||
function __init_pandoc{
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -41,3 +42,5 @@
|
||||
echo $(pandoc --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
|
||||
}
|
||||
}
|
||||
|
||||
__init_pandoc
|
||||
|
||||
@@ -6,11 +6,11 @@ set -u
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -6,7 +8,7 @@ pkg_cmd_name="postgres"
|
||||
|
||||
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:
|
||||
@@ -14,7 +16,7 @@ pkg_get_current_version() {
|
||||
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)"
|
||||
|
||||
@@ -22,7 +24,7 @@ pkg_install() {
|
||||
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
|
||||
@@ -33,7 +35,7 @@ pkg_link() {
|
||||
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/"
|
||||
@@ -51,7 +53,7 @@ pkg_post_install() {
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_done_message() {
|
||||
function pkg_done_message() {
|
||||
# TODO show with serviceman
|
||||
echo "Installed 'postgres' and 'psql' at $pkg_dst"
|
||||
echo ""
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# title: PostgreSQL (Postgres alias)
|
||||
# homepage: https://webinstall.dev/postgres
|
||||
# tagline: Alias for https://webinstall.dev/postgres
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_powershell() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -40,3 +40,5 @@
|
||||
echo "Installed 'pwsh' at $pkg_dst"
|
||||
}
|
||||
}
|
||||
|
||||
__init_powershell
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
#!/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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# title: PowerShell (pwsh alias)
|
||||
# homepage: https://webinstall.dev/powershell
|
||||
# tagline: Alias for https://webinstall.dev/powershell
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
set -e
|
||||
set -u
|
||||
|
||||
function __install_rg() {
|
||||
function __init_rg() {
|
||||
|
||||
###################
|
||||
# Install ripgrep #
|
||||
@@ -39,4 +39,4 @@ function __install_rg() {
|
||||
}
|
||||
}
|
||||
|
||||
__install_rg
|
||||
__init_rg
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# title: Ripgrep (alias)
|
||||
# homepage: https://webinstall.dev/rg
|
||||
# tagline: `ripgrep` (project) is an alias for `rg` (command)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# title: Rust (rustlang alias)
|
||||
# homepage: https://webinstall.dev/rustlang
|
||||
# tagline: Alias for https://webinstall.dev/rustlang
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_sd() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -36,3 +36,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__init_sd
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_shfmt() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -28,3 +28,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__init_shfmt
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
{
|
||||
#!/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
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_ssh_setpass() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
ssh-keygen -p -f "$HOME/.ssh/id_rsa"
|
||||
}
|
||||
|
||||
__init_ssh_setpass
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#!/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"
|
||||
@@ -12,3 +14,5 @@ set -u
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
__init_sudo
|
||||
|
||||
@@ -1,24 +1,29 @@
|
||||
# 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
|
||||
|
||||
@@ -1,22 +1,28 @@
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_vps_addswap() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -31,3 +31,5 @@
|
||||
# Cause swap to be activated on boot
|
||||
echo '/var/swapfile none swap sw 0 0' | tee -a /etc/fstab
|
||||
}
|
||||
|
||||
__init_vps_addswap "$@"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_vps_utils() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -13,3 +13,5 @@
|
||||
chmod a+x "$HOME/.local/bin/myip"
|
||||
chmod a+x "$HOME/.local/bin/vps-"*
|
||||
}
|
||||
|
||||
__init_vps_utils
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_watchexec() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -37,3 +37,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__init_watchexec
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_xz() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -45,3 +45,5 @@
|
||||
echo $(xz --version 2> /dev/null | head -n 1 | cut -d ' ' -f 4)
|
||||
}
|
||||
}
|
||||
|
||||
__init_xz
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
{
|
||||
function __init_yq() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -34,3 +34,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__init_yq
|
||||
|
||||
@@ -33,7 +33,7 @@ function __init_zoxide() {
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user