# foobar 0.99.9 (rev abcdef0123)
# This trims it down to just the version number:
# 0.99.9
- echo $(foo --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+ echo $(foo --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
curl -fsSL -o ~/.vim/plugins/example.vim "$WEBI_HOST/packages/vim-example/example.vim"
fi
- if ! grep 'source.*plugins.example.vim' -r ~/.vimrc >/dev/null 2>/dev/null; then
+ if ! grep 'source.*plugins.example.vim' -r ~/.vimrc > /dev/null 2> /dev/null; then
set +e
mkdir -p ~/.vim/plugins
printf '\n" example: reasonable defaults from webinstall.dev/vim-example\n' >> ~/.vimrc
{
-set -e
-set -u
+ set -e
+ set -u
-#WEBI_PKG=
-#WEBI_HOST=https://webinstall.dev
-export WEBI_HOST
+ #WEBI_PKG=
+ #WEBI_HOST=https://webinstall.dev
+ export WEBI_HOST
-mkdir -p "$HOME/.local/bin"
+ mkdir -p "$HOME/.local/bin"
-cat << EOF > "$HOME/.local/bin/webi"
+ cat << EOF > "$HOME/.local/bin/webi"
#!/bin/bash
set -e
EOF
-chmod a+x "$HOME/.local/bin/webi"
+ chmod a+x "$HOME/.local/bin/webi"
-if [ -n "${WEBI_PKG:-}" ]; then
- "$HOME/.local/bin/webi" "${WEBI_PKG}"
-fi
+ if [ -n "${WEBI_PKG:-}" ]; then
+ "$HOME/.local/bin/webi" "${WEBI_PKG}"
+ fi
}
# For installing from the extracted package tmp directory
pkg_install() {
- pushd "$WEBI_TMP" 2>&1 >/dev/null
+ pushd "$WEBI_TMP" 2>&1 > /dev/null
- if [ -n "$(command -v rsync 2>/dev/null | grep rsync)" ]; then
- rsync -Krl ./xmpl*/ "$pkg_src/" 2>/dev/null
- else
- cp -Hr ./xmpl*/* "$pkg_src/" 2>/dev/null
- cp -Hr ./xmpl*/.* "$pkg_src/" 2>/dev/null
- fi
- rm -rf ./xmpl*
+ if [ -n "$(command -v rsync 2> /dev/null | grep rsync)" ]; then
+ rsync -Krl ./xmpl*/ "$pkg_src/" 2> /dev/null
+ else
+ cp -Hr ./xmpl*/* "$pkg_src/" 2> /dev/null
+ cp -Hr ./xmpl*/.* "$pkg_src/" 2> /dev/null
+ fi
+ rm -rf ./xmpl*
- popd 2>&1 >/dev/null
+ popd 2>&1 > /dev/null
}
function __bootstrap_webi() {
-set -e
-set -u
-#set -x
-
-#WEBI_PKG=
-#PKG_NAME=
-# TODO should this be BASEURL instead?
-#WEBI_OS=
-#WEBI_ARCH=
-#WEBI_HOST=
-#WEBI_RELEASES=
-#WEBI_CSV=
-#WEBI_TAG=
-#WEBI_VERSION=
-#WEBI_MAJOR=
-#WEBI_MINOR=
-#WEBI_PATCH=
-# TODO not sure if BUILD is the best name for this
-#WEBI_BUILD=
-#WEBI_LTS=
-#WEBI_CHANNEL=
-#WEBI_EXT=
-#WEBI_FORMATS=
-#WEBI_PKG_URL=
-#WEBI_PKG_FILE=
-#PKG_OSES=
-#PKG_ARCHES=
-#PKG_FORMATS=
-WEBI_UA="$(uname -a)"
-export WEBI_HOST
-
-##
-## Set up tmp, download, and install directories
-##
-
-WEBI_TMP=${WEBI_TMP:-"$(mktemp -d -t webinstall-${WEBI_PKG:-}.XXXXXXXX)"}
-export _webi_tmp="${_webi_tmp:-"$HOME/.local/opt/webi-tmp.d"}"
-
-mkdir -p "$HOME/Downloads"
-mkdir -p "$HOME/.local/bin"
-mkdir -p "$HOME/.local/opt"
-
-##
-## Detect http client
-##
-set +e
-export WEBI_CURL="$(command -v curl)"
-export WEBI_WGET="$(command -v wget)"
-set -e
-
-
-# get the special formatted version (i.e. "go is go1.14" while node is "node v12.10.8")
-my_versioned_name=""
-_webi_canonical_name() {
- if [ -n "$my_versioned_name" ]; then
- echo "$my_versioned_name"
- return 0
- fi
+ set -e
+ set -u
+ #set -x
+
+ #WEBI_PKG=
+ #PKG_NAME=
+ # TODO should this be BASEURL instead?
+ #WEBI_OS=
+ #WEBI_ARCH=
+ #WEBI_HOST=
+ #WEBI_RELEASES=
+ #WEBI_CSV=
+ #WEBI_TAG=
+ #WEBI_VERSION=
+ #WEBI_MAJOR=
+ #WEBI_MINOR=
+ #WEBI_PATCH=
+ # TODO not sure if BUILD is the best name for this
+ #WEBI_BUILD=
+ #WEBI_LTS=
+ #WEBI_CHANNEL=
+ #WEBI_EXT=
+ #WEBI_FORMATS=
+ #WEBI_PKG_URL=
+ #WEBI_PKG_FILE=
+ #PKG_OSES=
+ #PKG_ARCHES=
+ #PKG_FORMATS=
+ WEBI_UA="$(uname -a)"
+ export WEBI_HOST
+
+ ##
+ ## Set up tmp, download, and install directories
+ ##
+
+ WEBI_TMP=${WEBI_TMP:-"$(mktemp -d -t webinstall-${WEBI_PKG:-}.XXXXXXXX)"}
+ export _webi_tmp="${_webi_tmp:-"$HOME/.local/opt/webi-tmp.d"}"
+
+ mkdir -p "$HOME/Downloads"
+ mkdir -p "$HOME/.local/bin"
+ mkdir -p "$HOME/.local/opt"
+
+ ##
+ ## Detect http client
+ ##
+ set +e
+ export WEBI_CURL="$(command -v curl)"
+ export WEBI_WGET="$(command -v wget)"
+ set -e
- if [ -n "$(command -v pkg_format_cmd_version)" ]; then
- my_versioned_name="$(pkg_format_cmd_version "$WEBI_VERSION")"
- else
- my_versioned_name="'$pkg_cmd_name' v$WEBI_VERSION"
- fi
+ # get the special formatted version (i.e. "go is go1.14" while node is "node v12.10.8")
+ my_versioned_name=""
+ _webi_canonical_name() {
+ if [ -n "$my_versioned_name" ]; then
+ echo "$my_versioned_name"
+ return 0
+ fi
- echo "$my_versioned_name"
-}
+ if [ -n "$(command -v pkg_format_cmd_version)" ]; then
+ my_versioned_name="$(pkg_format_cmd_version "$WEBI_VERSION")"
+ else
+ my_versioned_name="'$pkg_cmd_name' v$WEBI_VERSION"
+ fi
-# update symlinks according to $HOME/.local/opt and $HOME/.local/bin install paths.
-webi_link() {
- if [ -n "$(command -v pkg_link)" ]; then
- pkg_link
- return 0
- fi
+ echo "$my_versioned_name"
+ }
- if [ -n "$WEBI_SINGLE" ] || [ "single" == "${1:-}" ]; then
- rm -rf "$pkg_dst_cmd"
- ln -s "$pkg_src_cmd" "$pkg_dst_cmd"
- else
- # 'pkg_dst' will default to $HOME/.local/opt/<pkg>
- # 'pkg_src' will be the installed version, such as to $HOME/.local/opt/<pkg>-<version>
- rm -rf "$pkg_dst"
- ln -s "$pkg_src" "$pkg_dst"
- fi
-}
+ # update symlinks according to $HOME/.local/opt and $HOME/.local/bin install paths.
+ webi_link() {
+ if [ -n "$(command -v pkg_link)" ]; then
+ pkg_link
+ return 0
+ fi
-# detect if this program is already installed or if an installed version may cause conflict
-webi_check() {
- # Test for existing version
- set +e
- my_path="$PATH"
- export PATH="$(dirname "$pkg_dst_cmd"):$PATH"
- my_current_cmd="$(command -v "$pkg_cmd_name")"
- set -e
- if [ -n "$my_current_cmd" ]; then
- pkg_current_version="$(pkg_get_current_version 2>/dev/null | head -n 1)"
- # remove trailing '.0's for golang's sake
- my_current_version="$(echo $pkg_current_version | sed 's:\.0::g')"
- my_src_version="$(echo $WEBI_VERSION | sed 's:\.0::g')"
- my_canonical_name="$(_webi_canonical_name)"
- if [ "$my_src_version" == "$my_current_version" ]; then
- echo "$my_canonical_name already installed at $my_current_cmd"
- exit 0
+ if [ -n "$WEBI_SINGLE" ] || [ "single" == "${1:-}" ]; then
+ rm -rf "$pkg_dst_cmd"
+ ln -s "$pkg_src_cmd" "$pkg_dst_cmd"
else
- if [ "$my_current_cmd" != "$pkg_dst_cmd" ]; then
- >&2 echo "WARN: possible conflict between $my_canonical_name and $pkg_current_version at $my_current_cmd"
- fi
- if [ -x "$pkg_src_cmd" ]; then
- webi_link
- echo "switched to $my_canonical_name at $pkg_src"
+ # 'pkg_dst' will default to $HOME/.local/opt/<pkg>
+ # 'pkg_src' will be the installed version, such as to $HOME/.local/opt/<pkg>-<version>
+ rm -rf "$pkg_dst"
+ ln -s "$pkg_src" "$pkg_dst"
+ fi
+ }
+
+ # detect if this program is already installed or if an installed version may cause conflict
+ webi_check() {
+ # Test for existing version
+ set +e
+ my_path="$PATH"
+ export PATH="$(dirname "$pkg_dst_cmd"):$PATH"
+ my_current_cmd="$(command -v "$pkg_cmd_name")"
+ set -e
+ if [ -n "$my_current_cmd" ]; then
+ pkg_current_version="$(pkg_get_current_version 2> /dev/null | head -n 1)"
+ # remove trailing '.0's for golang's sake
+ my_current_version="$(echo $pkg_current_version | sed 's:\.0::g')"
+ my_src_version="$(echo $WEBI_VERSION | sed 's:\.0::g')"
+ my_canonical_name="$(_webi_canonical_name)"
+ if [ "$my_src_version" == "$my_current_version" ]; then
+ echo "$my_canonical_name already installed at $my_current_cmd"
exit 0
+ else
+ if [ "$my_current_cmd" != "$pkg_dst_cmd" ]; then
+ echo >&2 "WARN: possible conflict between $my_canonical_name and $pkg_current_version at $my_current_cmd"
+ fi
+ if [ -x "$pkg_src_cmd" ]; then
+ webi_link
+ echo "switched to $my_canonical_name at $pkg_src"
+ exit 0
+ fi
fi
- fi
- fi
- export PATH="$my_path"
-}
-
-# detect if file is downloaded, and how to download it
-webi_download() {
- if [ -n "${1:-}" ]; then
- my_url="$1"
- else
- if [ "error" == "$WEBI_CHANNEL" ]; then
- # TODO pass back requested OS / Arch / Version
- >&2 echo "Error: no '$PKG_NAME' release for '$WEBI_OS' on '$WEBI_ARCH' as one of '$WEBI_FORMATS' by the tag '$WEBI_TAG'"
- >&2 echo " '$PKG_NAME' is available for '$PKG_OSES' on '$PKG_ARCHES' as one of '$PKG_FORMATS'"
- >&2 echo " (check that the package name and version are correct)"
- >&2 echo ""
- >&2 echo " Double check at $(echo "$WEBI_RELEASES" | sed 's:\?.*::')"
- >&2 echo ""
- exit 1
fi
- my_url="$WEBI_PKG_URL"
- fi
- if [ -n "${2:-}" ]; then
- my_dl="$2"
- else
- my_dl="$HOME/Downloads/$WEBI_PKG_FILE"
- fi
-
- if [ -e "$my_dl" ]; then
- echo "Found $my_dl"
- return 0
- fi
-
- echo "Downloading $PKG_NAME from"
- echo "$my_url"
+ export PATH="$my_path"
+ }
- # It's only 2020, we can't expect to have reliable CLI tools
- # to tell us the size of a file as part of a base system...
- if [ -n "$WEBI_WGET" ]; then
- # wget has resumable downloads
- # TODO wget -c --content-disposition "$my_url"
- set +e
- my_show_progress=""
- if [[ $- == *i* ]]; then
- my_show_progress="--show-progress"
+ # detect if file is downloaded, and how to download it
+ webi_download() {
+ if [ -n "${1:-}" ]; then
+ my_url="$1"
+ else
+ if [ "error" == "$WEBI_CHANNEL" ]; then
+ # TODO pass back requested OS / Arch / Version
+ echo >&2 "Error: no '$PKG_NAME' release for '$WEBI_OS' on '$WEBI_ARCH' as one of '$WEBI_FORMATS' by the tag '$WEBI_TAG'"
+ echo >&2 " '$PKG_NAME' is available for '$PKG_OSES' on '$PKG_ARCHES' as one of '$PKG_FORMATS'"
+ echo >&2 " (check that the package name and version are correct)"
+ echo >&2 ""
+ echo >&2 " Double check at $(echo "$WEBI_RELEASES" | sed 's:\?.*::')"
+ echo >&2 ""
+ exit 1
+ fi
+ my_url="$WEBI_PKG_URL"
fi
- wget -q $my_show_progress --user-agent="wget $WEBI_UA" -c "$my_url" -O "$my_dl.part"
- if ! [ $? -eq 0 ]; then
- >&2 echo "failed to download from $WEBI_PKG_URL"
- exit 1
+ if [ -n "${2:-}" ]; then
+ my_dl="$2"
+ else
+ my_dl="$HOME/Downloads/$WEBI_PKG_FILE"
fi
- set -e
- else
- # Neither GNU nor BSD curl have sane resume download options, hence we don't bother
- # TODO curl -fsSL --remote-name --remote-header-name --write-out "$my_url"
- my_show_progress="-#"
- if [[ $- == *i* ]]; then
- my_show_progress=""
+
+ if [ -e "$my_dl" ]; then
+ echo "Found $my_dl"
+ return 0
fi
- curl -fSL $my_show_progress -H "User-Agent: curl $WEBI_UA" "$my_url" -o "$my_dl.part"
- fi
- mv "$my_dl.part" "$my_dl"
- echo ""
- echo "Saved as $my_dl"
-}
+ echo "Downloading $PKG_NAME from"
+ echo "$my_url"
+
+ # It's only 2020, we can't expect to have reliable CLI tools
+ # to tell us the size of a file as part of a base system...
+ if [ -n "$WEBI_WGET" ]; then
+ # wget has resumable downloads
+ # TODO wget -c --content-disposition "$my_url"
+ set +e
+ my_show_progress=""
+ if [[ $- == *i* ]]; then
+ my_show_progress="--show-progress"
+ fi
+ wget -q $my_show_progress --user-agent="wget $WEBI_UA" -c "$my_url" -O "$my_dl.part"
+ if ! [ $? -eq 0 ]; then
+ echo >&2 "failed to download from $WEBI_PKG_URL"
+ exit 1
+ fi
+ set -e
+ else
+ # Neither GNU nor BSD curl have sane resume download options, hence we don't bother
+ # TODO curl -fsSL --remote-name --remote-header-name --write-out "$my_url"
+ my_show_progress="-#"
+ if [[ $- == *i* ]]; then
+ my_show_progress=""
+ fi
+ curl -fSL $my_show_progress -H "User-Agent: curl $WEBI_UA" "$my_url" -o "$my_dl.part"
+ fi
+ mv "$my_dl.part" "$my_dl"
+
+ echo ""
+ echo "Saved as $my_dl"
+ }
-# detect which archives can be used
-webi_extract() {
- pushd "$WEBI_TMP" 2>&1 >/dev/null
+ # detect which archives can be used
+ webi_extract() {
+ pushd "$WEBI_TMP" 2>&1 > /dev/null
if [ "tar" == "$WEBI_EXT" ]; then
echo "Extracting $HOME/Downloads/$WEBI_PKG_FILE"
tar xf "$HOME/Downloads/$WEBI_PKG_FILE"
echo "Failed to extract $HOME/Downloads/$WEBI_PKG_FILE"
exit 1
fi
- popd 2>&1 >/dev/null
-}
-
-# use 'pathman' to update $HOME/.config/envman/PATH.env
-webi_path_add() {
- # make sure that we don't recursively install pathman with webi
- my_path="$PATH"
- export PATH="$HOME/.local/bin:$PATH"
-
- # install pathman if not already installed
- if [ -z "$(command -v pathman)" ]; then
- "$HOME/.local/bin/webi" pathman > /dev/null
- fi
-
- export PATH="$my_path"
-
- # in case pathman was recently installed and the PATH not updated
- mkdir -p "$_webi_tmp"
- # prevent "too few arguments" output on bash when there are 0 lines of stdout
- "$HOME/.local/bin/pathman" add "$1" | grep "export" 2>/dev/null >> "$_webi_tmp/.PATH.env" || true
-}
-
-# group common pre-install tasks as default
-webi_pre_install() {
- webi_check
- webi_download
- webi_extract
-}
-
-# move commands from the extracted archive directory to $HOME/.local/opt or $HOME/.local/bin
-webi_install() {
- if [ -n "$WEBI_SINGLE" ] || [ "single" == "${1:-}" ]; then
- mkdir -p "$(dirname $pkg_src_cmd)"
- mv ./"$pkg_cmd_name"* "$pkg_src_cmd"
- else
- rm -rf "$pkg_src"
- mv ./"$pkg_cmd_name"* "$pkg_src"
- fi
-}
-
-# run post-install functions - just updating PATH by default
-webi_post_install() {
- webi_path_add "$(dirname "$pkg_dst_cmd")"
-}
+ popd 2>&1 > /dev/null
+ }
+
+ # use 'pathman' to update $HOME/.config/envman/PATH.env
+ webi_path_add() {
+ # make sure that we don't recursively install pathman with webi
+ my_path="$PATH"
+ export PATH="$HOME/.local/bin:$PATH"
+
+ # install pathman if not already installed
+ if [ -z "$(command -v pathman)" ]; then
+ "$HOME/.local/bin/webi" pathman > /dev/null
+ fi
-_webi_enable_exec() {
- if [ -n "$(command -v spctl)" ] && [ -n "$(command -v xattr)" ] ; then
- # note: some packages contain files that cannot be affected by xattr
- xattr -r -d com.apple.quarantine "$pkg_src" || true
- return 0
- fi
- # TODO need to test that the above actually worked
- # (and proceed to this below if it did not)
- if [ -n "$(command -v spctl)" ]; then
- echo "Checking permission to execute '$pkg_cmd_name' on macOS 11+"
- set +e
- is_allowed="$(spctl -a "$pkg_src_cmd" 2>&1 | grep valid)"
- set -e
- if [ -z "$is_allowed" ]; then
- echo ""
- echo "##########################################"
- echo "# IMPORTANT: Permission Grant Required #"
- echo "##########################################"
- echo ""
- echo "Requesting permission to execute '$pkg_cmd_name' on macOS 10.14+"
- echo ""
- sleep 3
- spctl --add "$pkg_src_cmd"
+ export PATH="$my_path"
+
+ # in case pathman was recently installed and the PATH not updated
+ mkdir -p "$_webi_tmp"
+ # prevent "too few arguments" output on bash when there are 0 lines of stdout
+ "$HOME/.local/bin/pathman" add "$1" | grep "export" 2> /dev/null >> "$_webi_tmp/.PATH.env" || true
+ }
+
+ # group common pre-install tasks as default
+ webi_pre_install() {
+ webi_check
+ webi_download
+ webi_extract
+ }
+
+ # move commands from the extracted archive directory to $HOME/.local/opt or $HOME/.local/bin
+ webi_install() {
+ if [ -n "$WEBI_SINGLE" ] || [ "single" == "${1:-}" ]; then
+ mkdir -p "$(dirname $pkg_src_cmd)"
+ mv ./"$pkg_cmd_name"* "$pkg_src_cmd"
+ else
+ rm -rf "$pkg_src"
+ mv ./"$pkg_cmd_name"* "$pkg_src"
fi
- fi
-}
+ }
+
+ # run post-install functions - just updating PATH by default
+ webi_post_install() {
+ webi_path_add "$(dirname "$pkg_dst_cmd")"
+ }
+
+ _webi_enable_exec() {
+ if [ -n "$(command -v spctl)" ] && [ -n "$(command -v xattr)" ]; then
+ # note: some packages contain files that cannot be affected by xattr
+ xattr -r -d com.apple.quarantine "$pkg_src" || true
+ return 0
+ fi
+ # TODO need to test that the above actually worked
+ # (and proceed to this below if it did not)
+ if [ -n "$(command -v spctl)" ]; then
+ echo "Checking permission to execute '$pkg_cmd_name' on macOS 11+"
+ set +e
+ is_allowed="$(spctl -a "$pkg_src_cmd" 2>&1 | grep valid)"
+ set -e
+ if [ -z "$is_allowed" ]; then
+ echo ""
+ echo "##########################################"
+ echo "# IMPORTANT: Permission Grant Required #"
+ echo "##########################################"
+ echo ""
+ echo "Requesting permission to execute '$pkg_cmd_name' on macOS 10.14+"
+ echo ""
+ sleep 3
+ spctl --add "$pkg_src_cmd"
+ fi
+ fi
+ }
-# a friendly message when all is well, showing the final install path in $HOME/.local
-_webi_done_message() {
- echo "Installed $(_webi_canonical_name) as $pkg_dst_cmd"
-}
+ # a friendly message when all is well, showing the final install path in $HOME/.local
+ _webi_done_message() {
+ echo "Installed $(_webi_canonical_name) as $pkg_dst_cmd"
+ }
-##
-##
-## BEGIN custom override functions from <package>/install.sh
-##
-##
+ ##
+ ##
+ ## BEGIN custom override functions from <package>/install.sh
+ ##
+ ##
-WEBI_SINGLE=
+ WEBI_SINGLE=
-echo ""
-echo "Thanks for using webi to install '$PKG_NAME' on '$WEBI_OS/$WEBI_ARCH'."
-echo "Have a problem? Experience a bug? Please let us know:"
-echo " https://github.com/webinstall/packages/issues"
-echo ""
+ echo ""
+ echo "Thanks for using webi to install '$PKG_NAME' on '$WEBI_OS/$WEBI_ARCH'."
+ echo "Have a problem? Experience a bug? Please let us know:"
+ echo " https://github.com/webinstall/packages/issues"
+ echo ""
-function __init_installer() {
+ function __init_installer() {
-{{ installer }}
+ {{ installer }}
-}
+ }
-__init_installer
+ __init_installer
-##
-##
-## END custom override functions
-##
-##
+ ##
+ ##
+ ## END custom override functions
+ ##
+ ##
-# run everything with defaults or overrides as needed
-if [ -n "$(command -v pkg_get_current_version)" ]; then
- pkg_cmd_name="${pkg_cmd_name:-$PKG_NAME}"
+ # run everything with defaults or overrides as needed
+ if [ -n "$(command -v pkg_get_current_version)" ]; then
+ pkg_cmd_name="${pkg_cmd_name:-$PKG_NAME}"
- if [ -n "$WEBI_SINGLE" ]; then
- pkg_dst_cmd="${pkg_dst_cmd:-$HOME/.local/bin/$pkg_cmd_name}"
- pkg_dst="$pkg_dst_cmd" # "$(dirname "$(dirname $pkg_dst_cmd)")"
+ if [ -n "$WEBI_SINGLE" ]; then
+ pkg_dst_cmd="${pkg_dst_cmd:-$HOME/.local/bin/$pkg_cmd_name}"
+ pkg_dst="$pkg_dst_cmd" # "$(dirname "$(dirname $pkg_dst_cmd)")"
- #pkg_src_cmd="${pkg_src_cmd:-$HOME/.local/opt/$pkg_cmd_name-v$WEBI_VERSION/bin/$pkg_cmd_name-v$WEBI_VERSION}"
- pkg_src_cmd="${pkg_src_cmd:-$HOME/.local/opt/$pkg_cmd_name-v$WEBI_VERSION/bin/$pkg_cmd_name}"
- pkg_src="$pkg_src_cmd" # "$(dirname "$(dirname $pkg_src_cmd)")"
- else
- pkg_dst="${pkg_dst:-$HOME/.local/opt/$pkg_cmd_name}"
- pkg_dst_cmd="${pkg_dst_cmd:-$pkg_dst/bin/$pkg_cmd_name}"
+ #pkg_src_cmd="${pkg_src_cmd:-$HOME/.local/opt/$pkg_cmd_name-v$WEBI_VERSION/bin/$pkg_cmd_name-v$WEBI_VERSION}"
+ pkg_src_cmd="${pkg_src_cmd:-$HOME/.local/opt/$pkg_cmd_name-v$WEBI_VERSION/bin/$pkg_cmd_name}"
+ pkg_src="$pkg_src_cmd" # "$(dirname "$(dirname $pkg_src_cmd)")"
+ else
+ pkg_dst="${pkg_dst:-$HOME/.local/opt/$pkg_cmd_name}"
+ pkg_dst_cmd="${pkg_dst_cmd:-$pkg_dst/bin/$pkg_cmd_name}"
- pkg_src="${pkg_src:-$HOME/.local/opt/$pkg_cmd_name-v$WEBI_VERSION}"
- pkg_src_cmd="${pkg_src_cmd:-$pkg_src/bin/$pkg_cmd_name}"
- fi
- pkg_src_bin="$(dirname "$pkg_src_cmd")"
- pkg_dst_bin="$(dirname "$pkg_dst_cmd")"
+ pkg_src="${pkg_src:-$HOME/.local/opt/$pkg_cmd_name-v$WEBI_VERSION}"
+ pkg_src_cmd="${pkg_src_cmd:-$pkg_src/bin/$pkg_cmd_name}"
+ fi
+ pkg_src_bin="$(dirname "$pkg_src_cmd")"
+ pkg_dst_bin="$(dirname "$pkg_dst_cmd")"
- [ -n "$(command -v pkg_pre_install)" ] && pkg_pre_install || webi_pre_install
+ [ -n "$(command -v pkg_pre_install)" ] && pkg_pre_install || webi_pre_install
- pushd "$WEBI_TMP" 2>&1 >/dev/null
+ pushd "$WEBI_TMP" 2>&1 > /dev/null
echo "Installing to $pkg_src_cmd"
[ -n "$(command -v pkg_install)" ] && pkg_install || webi_install
chmod a+x "$pkg_src"
chmod a+x "$pkg_src_cmd"
- popd 2>&1 >/dev/null
+ popd 2>&1 > /dev/null
- webi_link
+ webi_link
- _webi_enable_exec
- pushd "$WEBI_TMP" 2>&1 >/dev/null
+ _webi_enable_exec
+ pushd "$WEBI_TMP" 2>&1 > /dev/null
[ -n "$(command -v pkg_post_install)" ] && pkg_post_install || webi_post_install
- popd 2>&1 >/dev/null
+ popd 2>&1 > /dev/null
- pushd "$WEBI_TMP" 2>&1 >/dev/null
+ pushd "$WEBI_TMP" 2>&1 > /dev/null
[ -n "$(command -v pkg_done_message)" ] && pkg_done_message || _webi_done_message
- popd 2>&1 >/dev/null
+ popd 2>&1 > /dev/null
- echo ""
-fi
+ echo ""
+ fi
-webi_path_add "$HOME/.local/bin"
-if [ -z "${_WEBI_CHILD:-}" ] && [ -f "\$_webi_tmp/.PATH.env" ]; then
- echo "You need to update your PATH to use $PKG_NAME:"
- echo ""
- cat "$_webi_tmp/.PATH.env" | sort -u
- rm -f "$_webi_tmp/.PATH.env"
-fi
+ webi_path_add "$HOME/.local/bin"
+ if [ -z "${_WEBI_CHILD:-}" ] && [ -f '$_webi_tmp/.PATH.env' ]; then
+ echo "You need to update your PATH to use $PKG_NAME:"
+ echo ""
+ cat "$_webi_tmp/.PATH.env" | sort -u
+ rm -f "$_webi_tmp/.PATH.env"
+ fi
-# cleanup the temp directory
-rm -rf "$WEBI_TMP"
+ # cleanup the temp directory
+ rm -rf "$WEBI_TMP"
-# See? No magic. Just downloading and moving files.
+ # See? No magic. Just downloading and moving files.
}
return '-';
}
- // quick hack for Apple Silicon M1
+ // quick hack for Apple Silicon M1
// Native: Darwin boomer.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 arm64
// Resetta: Darwin boomer.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 x86_64
ua = ua.replace(/xnu-.*RELEASE_[^\s]*/, '')
# arc v3.5.0 (25e050d) 2020-10-30T03:27:58Z
# This trims it down to just the version number:
# 3.5.0
- echo "$(arc version 2>/dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
+ echo "$(arc version 2> /dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
}
}
# Enter tmp
pushd .local\tmp
- # Remove any leftover tmp cruft
+ # Remove any leftover tmp cruft
Remove-Item -Path ".\awless-v*" -Recurse -ErrorAction Ignore
Remove-Item -Path ".\awless.exe" -Recurse -ErrorAction Ignore
# v2.1.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
# This trims it down to just the version number:
# 2.1.0
- echo "$(awless version 2>/dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')"
+ echo "$(awless version 2> /dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')"
}
pkg_install() {
```txt
# no numbers or headers, just highlighting and such
--style="plain"
-```
\ No newline at end of file
+```
& tar xf "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
# Move single binary into root of temporary folder
& move "$EXENAME" "$VERNAME"
-
+
# Settle unpacked archive into place
echo "New Name: $VERNAME"
WEBI_SINGLE=true
pkg_get_current_version() {
- # 'bat --version' has output in this format:
- # bat 0.15.4
- # This trims it down to just the version number:
- # 0.15.4
- echo $(bat --version 2>/dev/null | head -n 1 | cut -d' ' -f 2)
+ # 'bat --version' has output in this format:
+ # bat 0.15.4
+ # This trims it down to just the version number:
+ # 0.15.4
+ echo $(bat --version 2> /dev/null | head -n 1 | cut -d' ' -f 2)
}
pkg_install() {
# Straight from https://brew.sh
#/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
- needs_xcode="$(/usr/bin/xcode-select -p >/dev/null 2> /dev/null || echo "true")"
- if [[ -n "${needs_xcode}" ]]
- then
+ needs_xcode="$(/usr/bin/xcode-select -p > /dev/null 2> /dev/null || echo "true")"
+ if [[ -n ${needs_xcode} ]]; then
echo ""
echo ""
echo "ERROR: Run this command to install XCode Command Line Tools first:"
# Enter tmp
pushd .local\tmp
- # Remove any leftover tmp cruft
+ # Remove any leftover tmp cruft
Remove-Item -Path ".\caddy-v*" -Recurse -ErrorAction Ignore
Remove-Item -Path ".\caddy.exe" -Recurse -ErrorAction Ignore
# v2.1.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
# This trims it down to just the version number:
# 2.1.0
- echo "$(caddy version 2>/dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')"
+ echo "$(caddy version 2> /dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')"
}
pkg_install() {
# ChromeDriver 88.0.4324.96 (68dba2d8a0b149a1d3afac56fa74648032bcf46b-refs/branch-heads/4324@{#1784})
# This trims it down to just the version number:
# 88.0.4324.96
- echo $(chromedriver --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+ echo $(chromedriver --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
WEBI_SINGLE=true
pkg_get_current_version() {
- # 'comrak --version' has output in this format:
- # comrak 0.8.1
- # This trims it down to just the version number:
- # 0.8.1
- echo $(comrak --version 2>/dev/null | head -n 1 | cut -d' ' -f 2)
+ # 'comrak --version' has output in this format:
+ # comrak 0.8.1
+ # This trims it down to just the version number:
+ # 0.8.1
+ echo $(comrak --version 2> /dev/null | head -n 1 | cut -d' ' -f 2)
}
pkg_install() {
& tar xf "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
# Move single binary into root of temporary folder
& move "$EXENAME" "$VERNAME"
-
+
# Settle unpacked archive into place
echo "New Name: $VERNAME"
WEBI_SINGLE=true
pkg_get_current_version() {
- # 'curlie --version' has output in this format:
- # TODO
- # This trims it down to just the version number:
- # TODO
- #echo $(curlie --version 2>/dev/null | head -n 1 | cut -d' ' -f 2)
- # See https://github.com/rs/curlie/issues/22
- echo "0.0.0"
+ # 'curlie --version' has output in this format:
+ # TODO
+ # This trims it down to just the version number:
+ # TODO
+ #echo $(curlie --version 2>/dev/null | head -n 1 | cut -d' ' -f 2)
+ # See https://github.com/rs/curlie/issues/22
+ echo "0.0.0"
}
pkg_install() {
# typescript 3.9.2
# This trims it down to just the version number:
# 1.1.1
- echo "$(deno --version 2>/dev/null | head -n 1 | cut -d' ' -f2)"
+ echo "$(deno --version 2> /dev/null | head -n 1 | cut -d' ' -f2)"
}
pkg_install() {
# dotenv-linter 0.99.9 (rev abcdef0123)
# This trims it down to just the version number:
# 0.99.9
- echo $(dotenv-linter --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+ echo $(dotenv-linter --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
# dotenv v1.0.0 (17c7677) 2020-10-19T23:43:57Z
# This trims it down to just the version number:
# 1.0.0
- echo "$(dotenv --version 2>/dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
+ echo "$(dotenv --version 2> /dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
}
}
& tar xf "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
# Move single binary into root of temporary folder
& move "$EXENAME" "$VERNAME"
-
+
# Settle unpacked archive into place
echo "New Name: $VERNAME"
WEBI_SINGLE=true
pkg_get_current_version() {
- # 'fd --version' has output in this format:
- # fd 8.1.1
- # This trims it down to just the version number:
- # 8.1.1
- echo $(fd --version 2>/dev/null | head -n 1 | cut -d' ' -f 2)
+ # 'fd --version' has output in this format:
+ # fd 8.1.1
+ # This trims it down to just the version number:
+ # 8.1.1
+ echo $(fd --version 2> /dev/null | head -n 1 | cut -d' ' -f 2)
}
pkg_install() {
# ...
# This trims it down to just the version number:
# 4.3.1
- echo $(ffmpeg -version 2>/dev/null | head -n 1 | cut -d ' ' -f 3)
+ echo $(ffmpeg -version 2> /dev/null | head -n 1 | cut -d ' ' -f 3)
}
}
# fish, version 3.1.2
# This trims it down to just the version number:
# 3.1.2
- echo $(fish --version 2>/dev/null | head -n 1 | cut -d ' ' -f 3)
+ echo $(fish --version 2> /dev/null | head -n 1 | cut -d ' ' -f 3)
}
pkg_src_dir="$HOME/.local/opt/flutter-v$WEBI_VERSION"
pkg_src="$pkg_src_dir"
-
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
# Tools • Dart 2.9.0 (build 2.9.0-14.1.beta)
# This trims it down to just the version number:
# 1.19.0-4.1.pre
- echo "$(flutter --version 2>/dev/null | head -n 1 | cut -d' ' -f2)"
+ echo "$(flutter --version 2> /dev/null | head -n 1 | cut -d' ' -f2)"
}
pkg_format_cmd_version() {
& tar xf "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
# Move single binary into root of temporary folder
& move "$EXENAME" "$VERNAME"
-
+
# Settle unpacked archive into place
echo "New Name: $VERNAME"
WEBI_SINGLE=true
pkg_get_current_version() {
- # 'fzf --version' has output in this format:
- # 0.21.1 (334a4fa)
- # This trims it down to just the version number:
- # 0.21.1
- echo $(fzf --version 2>/dev/null | head -n 1 | cut -d' ' -f 1)
+ # 'fzf --version' has output in this format:
+ # 0.21.1 (334a4fa)
+ # This trims it down to just the version number:
+ # 0.21.1
+ echo $(fzf --version 2> /dev/null | head -n 1 | cut -d' ' -f 1)
}
pkg_install() {
# gitdeploy v0.7.1 (be68fec) 2020-10-20T22:27:47Z)
# This trims it down to just the version number:
# 0.7.1
- echo "$(gitdeploy --version 2>/dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
+ echo "$(gitdeploy --version 2> /dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
}
}
# v2.1.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
# This trims it down to just the version number:
# 2.0.0
- echo "$(gitea --version 2>/dev/null | head -n 1 | cut -d' ' -f3)"
+ echo "$(gitea --version 2> /dev/null | head -n 1 | cut -d' ' -f3)"
}
pkg_link() {
echo gopls
& "$pkg_dst_cmd" get golang.org/x/tools/gopls
echo golint
-& "$pkg_dst_cmd" get golang.org/x/lint/golint
+& "$pkg_dst_cmd" get golang.org/x/lint/golint
echo errcheck
-& "$pkg_dst_cmd" get github.com/kisielk/errcheck
+& "$pkg_dst_cmd" get github.com/kisielk/errcheck
echo gotags
-& "$pkg_dst_cmd" get github.com/jstemmer/gotags
+& "$pkg_dst_cmd" get github.com/jstemmer/gotags
echo goimports
-& "$pkg_dst_cmd" get golang.org/x/tools/cmd/goimports
+& "$pkg_dst_cmd" get golang.org/x/tools/cmd/goimports
echo gorename
-& "$pkg_dst_cmd" get golang.org/x/tools/cmd/gorename
+& "$pkg_dst_cmd" get golang.org/x/tools/cmd/gorename
echo gotype
-& "$pkg_dst_cmd" get golang.org/x/tools/cmd/gotype
+& "$pkg_dst_cmd" get golang.org/x/tools/cmd/gotype
echo stringer
-& "$pkg_dst_cmd" get golang.org/x/tools/cmd/stringer
+& "$pkg_dst_cmd" get golang.org/x/tools/cmd/stringer
# Add to path
& "$Env:USERPROFILE\.local\bin\pathman.exe" add ~/.local/opt/go/bin
# go version go1.14.2 darwin/amd64
# This trims it down to just the version number:
# 1.14.2
- echo "$(go version 2>/dev/null | head -n 1 | cut -d' ' -f3 | sed 's:go::')"
+ echo "$(go version 2> /dev/null | head -n 1 | cut -d' ' -f3 | sed 's:go::')"
}
pkg_format_cmd_version() {
# goreleaser 0.99.9 (rev abcdef0123)
# This trims it down to just the version number:
# 0.99.9
- echo $(goreleaser --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+ echo $(goreleaser --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
# example output
# 9:12PM INF Running proxy! from=https://localhost:9001 to=http://localhost:9000
```
-And you're off to the races!
+And you're off to the races!
That is... if you're app happens to be running on port `9000`. If not, no worries! Simply pass the target port option `-t, --target` and specify the port your app _is_ running on.
# Enter tmp
pushd .local\tmp
- # Remove any leftover tmp cruft
+ # Remove any leftover tmp cruft
Remove-Item -Path ".\gprox-v*" -Recurse -ErrorAction Ignore
Remove-Item -Path ".\gprox.exe" -Recurse -ErrorAction Ignore
# Windows BSD-tar handles zip. Imagine that.
echo "Unpacking $pkg_download"
& tar xf "$pkg_download"
-
+
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
New-Item "$pkg_src_bin" -ItemType Directory
# gprox 0.99.9 (rev abcdef0123)
# This trims it down to just the version number:
# 0.99.9
- echo $(gprox --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+ echo $(gprox --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
WEBI_SINGLE=true
pkg_get_current_version() {
- # 'hexyl --version' has output in this format:
- # hexyl 0.8.0
- # This trims it down to just the version number:
- # 0.8.0
- echo $(hexyl --version 2>/dev/null | head -n 1 | cut -d' ' -f 2)
+ # 'hexyl --version' has output in this format:
+ # hexyl 0.8.0
+ # This trims it down to just the version number:
+ # 0.8.0
+ echo $(hexyl --version 2> /dev/null | head -n 1 | cut -d' ' -f 2)
}
pkg_install() {
# 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:
# 0.72.0
- echo "$(hugo version 2>/dev/null | head -n 1 | cut -d' ' -f5 | cut -d '-' -f1 | sed 's:^v::')"
+ echo "$(hugo version 2> /dev/null | head -n 1 | cut -d' ' -f5 | cut -d '-' -f1 | sed 's:^v::')"
}
WEBI_SINGLE=true
pkg_get_current_version() {
- # 'jq --version' has output in this format:
- # jq-1.6
- # This trims it down to just the version number:
- # 1.6
- echo $(jq --version 2>/dev/null | head -n 1 | sed 's:^jq-::')
+ # 'jq --version' has output in this format:
+ # jq-1.6
+ # This trims it down to just the version number:
+ # 1.6
+ echo $(jq --version 2> /dev/null | head -n 1 | sed 's:^jq-::')
}
}
Start K9s in readonly mode - with all cluster modification commands disabled
```bash
k9s --readonly
-```
\ No newline at end of file
+```
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
- New-Item "$pkg_src_bin" -ItemType Directory -Force
+ New-Item "$pkg_src_bin" -ItemType Directory -Force
Move-Item -Path "k9s.exe" -Destination "$pkg_src_bin"
# Exit tmp
# This trims it down to just the version number:
# 0.24.2
- echo $(k9s version 2>/dev/null | grep Version: | cut -d 'v' -f 2)
+ echo $(k9s version 2> /dev/null | grep Version: | cut -d 'v' -f 2)
}
}
# keypairs v0.6.5 (7e6fd17) 2020-10-21T06:26:46Z
# This trims it down to just the version number:
# 0.6.5
- echo "$(keypairs --version 2>/dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
+ echo "$(keypairs --version 2> /dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
}
}
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
- New-Item "$pkg_src_bin" -ItemType Directory -Force
+ New-Item "$pkg_src_bin" -ItemType Directory -Force
Move-Item -Path "kubectx.exe" -Destination "$pkg_src_bin"
# Exit tmp
# pkg_get_current_version is recommended, but (soon) not required
pkg_get_current_version() {
# 'kubectx' has no version parameter
- echo
+ echo
}
}
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
- New-Item "$pkg_src_bin" -ItemType Directory -Force
+ New-Item "$pkg_src_bin" -ItemType Directory -Force
Move-Item -Path "kubens.exe" -Destination "$pkg_src_bin"
# Exit tmp
# pkg_get_current_version is recommended, but (soon) not required
pkg_get_current_version() {
# 'kubens' has no version parameter
- echo
+ echo
}
}
});
return all;
});
-};
+};
if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
# r21
# This treats it as a minor version number:
# 0.21.0
- echo "0.$(lf --version 2>/dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^r::').0"
+ echo "0.$(lf --version 2> /dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^r::').0"
}
}
# Enter tmp
pushd .local\tmp
- # Remove any leftover tmp cruft
+ # Remove any leftover tmp cruft
Remove-Item -Path ".\lsd-v*" -Recurse -ErrorAction Ignore
Remove-Item -Path ".\lsd.exe" -Recurse -ErrorAction Ignore
# Windows BSD-tar handles zip. Imagine that.
echo "Unpacking $pkg_download"
& tar xf "$pkg_download"
-
+
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
# lsd 0.17.0
# This trims it down to just the version number:
# 0.17.0
- echo $(lsd --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+ echo $(lsd --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
webi_download
-pushd ~/Downloads 2>&1 >/dev/null
+pushd ~/Downloads 2>&1 > /dev/null
if [ "Darwin" == "$(uname -s)" ]; then
- curl -fsSL 'https://gist.githubusercontent.com/solderjs/8c36d132250163011c83bad8284975ee/raw/5a291955813743c20c12ca2d35c7b1bb34f8aecc/create-bootable-installer-for-os-x-el-capitan.sh' -o create-bootable-installer-for-os-x-el-capitan.sh
- bash create-bootable-installer-for-os-x-el-capitan.sh
+ curl -fsSL 'https://gist.githubusercontent.com/solderjs/8c36d132250163011c83bad8284975ee/raw/5a291955813743c20c12ca2d35c7b1bb34f8aecc/create-bootable-installer-for-os-x-el-capitan.sh' -o create-bootable-installer-for-os-x-el-capitan.sh
+ bash create-bootable-installer-for-os-x-el-capitan.sh
else
- curl -fsSL 'https://gist.githubusercontent.com/solderjs/9834a45a6c21a41e8882698a00b55787/raw/c43061cd0c53ec675996f5cb66c7077e666aabd4/install-mac-tools.sh' -o install-mac-tools.sh
- # TODO add xar to webinstall.dev
- sudo apt install libz-dev # needed for xar
- bash install-mac-tools.sh
- echo "WARN: may need a restart for hfsplus to be recognized by the kernel"
+ curl -fsSL 'https://gist.githubusercontent.com/solderjs/9834a45a6c21a41e8882698a00b55787/raw/c43061cd0c53ec675996f5cb66c7077e666aabd4/install-mac-tools.sh' -o install-mac-tools.sh
+ # TODO add xar to webinstall.dev
+ sudo apt install libz-dev # needed for xar
+ bash install-mac-tools.sh
+ echo "WARN: may need a restart for hfsplus to be recognized by the kernel"
- curl -fsSL 'https://gist.github.com/solderjs/04fd06560a8465a695337eb502f5b0e9/raw/0a06fb4dce91399d374d9a12958dabb48a9bd42a/empty.7400m.img.bz2' -o empty.7400m.img.bz2
+ curl -fsSL 'https://gist.github.com/solderjs/04fd06560a8465a695337eb502f5b0e9/raw/0a06fb4dce91399d374d9a12958dabb48a9bd42a/empty.7400m.img.bz2' -o empty.7400m.img.bz2
- curl -fsSL 'https://gist.githubusercontent.com/solderjs/9834a45a6c21a41e8882698a00b55787/raw/c43061cd0c53ec675996f5cb66c7077e666aabd4/linux-create-bootable-macos-recovery-image.sh' -o linux-create-bootable-macos-recovery-image.sh
- bash linux-create-bootable-macos-recovery-image.sh
+ curl -fsSL 'https://gist.githubusercontent.com/solderjs/9834a45a6c21a41e8882698a00b55787/raw/c43061cd0c53ec675996f5cb66c7077e666aabd4/linux-create-bootable-macos-recovery-image.sh' -o linux-create-bootable-macos-recovery-image.sh
+ bash linux-create-bootable-macos-recovery-image.sh
fi
echo ""
echo "Created $HOME/Downloads/el-capitan.iso"
echo ""
-popd 2>&1 >/dev/null
+popd 2>&1 > /dev/null
# 0.11.8
# This trims it down to just the version number:
# 0.11.8
- echo $(mutagen version 2>/dev/null | head -n 1 | cut -d ' ' -f1)
+ echo $(mutagen version 2> /dev/null | head -n 1 | cut -d ' ' -f1)
}
}
set -u
rm -f "$HOME/.local/bin/myip"
- webi_download "$WEBI_HOST/packages/myip/myip.sh" "$HOME/.local/bin/myip"
+ webi_download "$WEBI_HOST/packages/myip/myip.sh" "$HOME/.local/bin/myip"
chmod a+x "$HOME/.local/bin/myip"
"$HOME/.local/bin/myip"
ipv4=$(curl -s https://api.ipify.org || true)
ipv6=$(curl -s https://api6.ipify.org || true)
- if [[ -n "${ipv4}" ]]; then
+ if [[ -n ${ipv4} ]]; then
echo "IPv4 (A) : $ipv4"
fi
- if [[ -n "$ipv6" ]] && [[ "ipv6" != "ipv4" ]]; then
+ if [[ -n $ipv6 ]] && [[ "ipv6" != "ipv4" ]]; then
echo "IPv6 (AAAA): $ipv6"
fi
- if [[ -z "$ipv4" ]] && [[ -z "ipv6" ]]; then
- >&2 echo "error: no public IP address"
+ if [[ -z $ipv4 ]] && [[ -z "ipv6" ]]; then
+ echo >&2 "error: no public IP address"
fi
}
IF (!(Test-Path -Path "$my_fontdir\$my_nerdfont_otf"))
{
- & curl.exe -fsSLo "$my_nerdfont_otf" 'https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete%20Windows%20Compatible.otf'
+ & curl.exe -fsSLo "$my_nerdfont_otf" 'https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete
+/Droid%20Sans%20Mono%20Nerd%20Font%20Complete%20Windows%20Compatible.otf'
& move "$my_nerdfont_otf" "$my_fontdir"
}
-# See https://superuser.com/a/1306464/73857
pushd "$my_fontdir"
-Add-Type -Name Session -Namespace "" -Member @"
-[DllImport("gdi32.dll")]
-public static extern int AddFontResource(string filePath);
-"@
-$null = foreach($font in Get-ChildItem -Recurse -Include *.ttf, *.otf) {
- [Session]::AddFontResource($font.FullName)
+$regFontPath = "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
+$fontRegistryPath = "HKCU:$regFontPath"
+$fontFiles = Get-ChildItem -Recurse -Include *.ttf, *.otf
+$null = foreach($font in $fontFiles) {
+ # See https://github.com/PPOSHGROUP/PPoShTools/blob/master/PPoShTools/Public/FileSystem/Add-Font.ps1#L80
+ Add-Type -AssemblyName System.Drawing
+ $objFontCollection = New-Object System.Drawing.Text.PrivateFontCollection
+ $objFontCollection.AddFontFile($font.FullName)
+ $FontName = $objFontCollection.Families.Name
+
+ $regTest = Get-ItemProperty -Path $fontRegistryPath -Name "*$FontName*" -ErrorAction SilentlyContinue
+ if (-not ($regTest)) {
+ New-ItemProperty -Name $FontName -Path $fontRegistryPath -PropertyType string -Value $font.FullName
+ Write-Output "Registering font {$($font.Name)} in registry with name {$FontName}"
+ }
}
echo "Installed $my_nerdfont_otf to $my_fontdir"
install() {
- set -e
- set -u
+ set -e
+ set -u
- my_nerdfont="Droid Sans Mono for Powerline Nerd Font Complete.otf"
- curl -fsSLo "$my_nerdfont" \
- 'https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf'
+ my_nerdfont="Droid Sans Mono for Powerline Nerd Font Complete.otf"
+ curl -fsSLo "$my_nerdfont" \
+ 'https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf'
+ my_fontdir=""
+ if [ -e "$HOME/Library/Fonts" ]; then
+ # OS X
+ mv "$my_nerdfont" ~/Library/Fonts/
+ my_fontdir="~/Library/Fonts/"
+ else
+ # Linux
+ mkdir -p ~/.local/share/fonts
+ mv "$my_nerdfont" ~/.local/share/fonts/
+ my_fontdir="~/.local/share/fonts/"
+ fi
- my_fontdir=""
- if [ -e "$HOME/Library/Fonts" ]; then
- # OS X
- mv "$my_nerdfont" ~/Library/Fonts/
- my_fontdir="~/Library/Fonts/"
- else
- # Linux
- mkdir -p ~/.local/share/fonts
- mv "$my_nerdfont" ~/.local/share/fonts/
- my_fontdir="~/.local/share/fonts/"
- fi
-
- echo "Installed $my_nerdfont to $my_fontdir"
+ echo "Installed $my_nerdfont to $my_fontdir"
}
install
# v12.8.0
# This trims it down to just the version number:
# 12.8.0
- echo "$(node --version 2>/dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')"
+ echo "$(node --version 2> /dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')"
}
pkg_install() {
# Enter tmp
pushd .local\tmp
- # Remove any leftover tmp cruft
+ # Remove any leftover tmp cruft
Remove-Item -Path ".\pandoc-v*" -Recurse -ErrorAction Ignore
Remove-Item -Path ".\pandoc.exe" -Recurse -ErrorAction Ignore
# Windows BSD-tar handles zip. Imagine that.
echo "Unpacking $pkg_download"
& tar xf "$pkg_download"
-
+
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
# for a particular purpose.
# This trims it down to just the version number:
# 2.10.1
- echo $(pandoc --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+ echo $(pandoc --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
WEBI_SINGLE=true
pkg_get_current_version() {
- echo $(pathman version 2>/dev/null | head -n 1 | cut -d ' ' -f2 | sed 's:^v::')
+ echo $(pathman version 2> /dev/null | head -n 1 | cut -d ' ' -f2 | sed 's:^v::')
}
pkg_done_message() {
# postgres (PostgreSQL) 10.13
# This trims it down to just the version number:
# 10.13
- echo "$(postgres --version 2>/dev/null | head -n 1 | cut -d' ' -f3)"
+ echo "$(postgres --version 2> /dev/null | head -n 1 | cut -d' ' -f3)"
}
pkg_install() {
chmod 0700 "$POSTGRES_DATA_DIR"
if [ ! -f "$POSTGRES_DATA_DIR/postgresql.conf" ]; then
- echo "postgres" > "$PWFILE"
- "$pkg_src/bin/initdb" \
- -D "$POSTGRES_DATA_DIR/" \
- --username postgres --pwfile "$PWFILE" \
- --auth-local=password --auth-host=password
+ echo "postgres" > "$PWFILE"
+ "$pkg_src/bin/initdb" \
+ -D "$POSTGRES_DATA_DIR/" \
+ --username postgres --pwfile "$PWFILE" \
+ --auth-local=password --auth-host=password
fi
}
echo " psql 'postgres://postgres:postgres@localhost:5432/postgres'"
echo ""
}
-
# PowerShell 7.0.2
# This trims it down to just the version number:
# 7.0.2
- echo "$(pwsh --version 2>/dev/null | head -n 1 | cut -d' ' -f2)"
+ echo "$(pwsh --version 2> /dev/null | head -n 1 | cut -d' ' -f2)"
}
pkg_install() {
mv ./* "$pkg_src"
# symlink powershell to pwsh
- pushd "$pkg_src" >/dev/null
- ln -s pwsh powershell
- popd >/dev/null
+ pushd "$pkg_src" > /dev/null
+ ln -s pwsh powershell
+ popd > /dev/null
}
pkg_link() {
#!/bin/bash
-if [ -z "$(npm --version 2>/dev/null)" ]; then
+if [ -z "$(npm --version 2> /dev/null)" ]; then
webi node
export PATH="$HOME/.local/opt/node/bin:$PATH"
fi
if [ ! -f ~/.bashrc ] || [ -z "$(grep 'pyenv init' ~/.bashrc)" ]; then
echo '' >> ~/.bashrc
echo '# added by Webi for pyenv' >> ~/.bashrc
- echo 'eval "$(pyenv init -)"'>> ~/.bashrc
- echo 'eval "$(pyenv virtualenv-init -)"'>> ~/.bashrc
+ echo 'eval "$(pyenv init -)"' >> ~/.bashrc
+ echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
fi
if [ -n "$(command -v zsh)" ]; then
# - go version: go1.15.7
# This trims it down to just the version number:
# 1.54.0
- echo "$(rclone --version 2>/dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
+ echo "$(rclone --version 2> /dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
}
}
# Enter tmp
pushd .local\tmp
- # Remove any leftover tmp cruft
+ # Remove any leftover tmp cruft
Remove-Item -Path ".\ripgrep-v*" -Recurse -ErrorAction Ignore
Remove-Item -Path ".\rg.exe" -Recurse -ErrorAction Ignore
# Windows BSD-tar handles zip. Imagine that.
echo "Unpacking $pkg_download"
& tar xf "$pkg_download"
-
+
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
# +SIMD -AVX (runtime)
# This trims it down to just the version number:
# 12.1.1
- echo $(rg --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+ echo $(rg --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
}
pkg_get_current_version() {
- echo $(sass --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+ echo $(sass --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
# sclient 1.3.3 (455db50) 2020-12-02T22:05:35Z
# This trims it down to just the version number:
# 1.3.3
- echo "$(sclient --version 2>/dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
+ echo "$(sclient --version 2> /dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
}
}
# Windows BSD-tar handles zip. Imagine that.
echo "Unpacking $pkg_download"
& tar xf "$pkg_download"
-
+
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
# ~/.local/opt/sd-v0.99.9/bin
mkdir -p "$(dirname $pkg_src_cmd)"
# mv ./sd-*/sd "$pkg_src_cmd"
- mv sd-* "$pkg_src_cmd"
+ mv sd-* "$pkg_src_cmd"
}
# pkg_get_current_version is recommended, but (soon) not required
# sd 0.99.9 (rev abcdef0123)
# This trims it down to just the version number:
# 0.99.9
- echo $(sd --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+ echo $(sd --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
-
}
# serviceman v0.8.0 (f3ab547) 2020-12-02T16:19:10-07:00
# This trims it down to just the version number:
# 0.8.0
- echo "$(serviceman --version 2>/dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
+ echo "$(serviceman --version 2> /dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
}
}
#!/bin/bash
{
- set -e
- set -u
+ set -e
+ set -u
- ##################
- # Install shfmt #
- ##################
+ ##################
+ # Install shfmt #
+ ##################
- pkg_cmd_name="shfmt"
+ pkg_cmd_name="shfmt"
- pkg_dst_cmd="$HOME/.local/bin/shfmt"
- pkg_dst="$pkg_dst_cmd"
+ pkg_dst_cmd="$HOME/.local/bin/shfmt"
+ pkg_dst="$pkg_dst_cmd"
- pkg_src_cmd="$HOME/.local/opt/shfmt-v$WEBI_VERSION/bin/shfmt"
- pkg_src_dir="$HOME/.local/opt/shfmt-v$WEBI_VERSION"
- pkg_src="$pkg_src_cmd"
+ pkg_src_cmd="$HOME/.local/opt/shfmt-v$WEBI_VERSION/bin/shfmt"
+ pkg_src_dir="$HOME/.local/opt/shfmt-v$WEBI_VERSION"
+ pkg_src="$pkg_src_cmd"
- pkg_install() {
- # ~/.local/opt/shfmt-v0.99.9/bin
- mkdir -p "$(dirname $pkg_src_cmd)"
- mv ./"$pkg_cmd_name"* "$pkg_src_cmd"
- }
+ pkg_install() {
+ # ~/.local/opt/shfmt-v0.99.9/bin
+ mkdir -p "$(dirname $pkg_src_cmd)"
+ mv ./"$pkg_cmd_name"* "$pkg_src_cmd"
+ }
- pkg_get_current_version() {
- echo $(shfmt --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
- }
+ pkg_get_current_version() {
+ echo $(shfmt --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
+ }
}
MY_CMD="ssh-pubkey"
rm -f "$HOME/.local/bin/$MY_CMD"
- webi_download "$WEBI_HOST/packages/$MY_CMD/$MY_CMD.sh" "$HOME/.local/bin/$MY_CMD"
+ webi_download "$WEBI_HOST/packages/$MY_CMD/$MY_CMD.sh" "$HOME/.local/bin/$MY_CMD"
chmod a+x "$HOME/.local/bin/$MY_CMD"
# run the command
{
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"
+ 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-"*
}
# TODO would $EUID be better?
if [ "root" != "$(whoami)" ]; then
- echo "webi adduser: running user is already a non-root user"
- exit 0
+ echo "webi adduser: running user is already a non-root user"
+ exit 0
fi
#apt-get -y update
# Install webi for the new 'app' user
WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"}
- sudo -i -u "$my_name" bash -c "curl -fsSL '$WEBI_HOST/webi' | bash" \
- || sudo -i -u "$my_name" bash -c "wget -q -O - '$WEBI_HOST/webi' | bash"
+ sudo -i -u "$my_name" bash -c "curl -fsSL '$WEBI_HOST/webi' | bash" ||
+ sudo -i -u "$my_name" bash -c "wget -q -O - '$WEBI_HOST/webi' | bash"
# TODO ensure that ssh-password login is off
if [ ! -f "$HOME/.ssh/id_rsa" ]; then
ssh-keygen -b 2048 -t rsa -f "$HOME/.ssh/id_rsa" -q -N ""
- >&2 echo ""
+ echo >&2 ""
fi
if [ ! -f "$HOME/.ssh/id_rsa.pub" ]; then
ssh-keygen -y -f "$HOME/.ssh/id_rsa" > "$HOME/.ssh/id_rsa.pub"
- >&2 echo ""
+ echo >&2 ""
fi
# TODO use the comment (if any) for the name of the file
- >&2 echo ""
- >&2 echo "~/Downloads/id_rsa.$(whoami).pub":
- >&2 echo ""
+ echo >&2 ""
+ echo >&2 "~/Downloads/id_rsa.$(whoami).pub":
+ echo >&2 ""
rm -f "$HOME/Downloads/id_rsa.$(whoami).pub"
cp -r "$HOME/.ssh/id_rsa.pub" "$HOME/Downloads/id_rsa.$(whoami).pub"
cat "$HOME/Downloads/id_rsa.$(whoami).pub"
- >&2 echo ""
+ echo >&2 ""
}
{
if [ -z "$(command -v sudo)" ]; then
- >&2 echo "Error: on Linux and BSD you should install sudo via the native package manager"
- >&2 echo " for example: apt install -y sudo"
+ echo >&2 "Error: on Linux and BSD you should install sudo via the native package manager"
+ echo >&2 " for example: apt install -y sudo"
exit 1
else
echo "'sudo' already installed"
# syncthing v1.12.1 "Fermium Flea" (go1.15.5 darwin-amd64) teamcity@build.syncthing.net 2020-12-06 12:46:27 UTC
# This trims it down to just the version number:
# 1.12.1
- echo "$(syncthing --version 2>/dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
+ echo "$(syncthing --version 2> /dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
}
}
curl -fsSL -o ~/.vim/plugins/ale.vim "$WEBI_HOST/packages/vim-ale/ale.vim"
fi
- if ! grep 'source.*plugins.ale.vim' -r ~/.vimrc >/dev/null 2>/dev/null; then
+ if ! grep 'source.*plugins.ale.vim' -r ~/.vimrc > /dev/null 2> /dev/null; then
set +e
mkdir -p ~/.vim/plugins
printf '\n" ALE: reasonable defaults from webinstall.dev/vim-ale\n' >> ~/.vimrc
# mostly lightweight, or essential
webi \
- vim-leader \
- vim-shell \
- vim-sensible \
- vim-viminfo \
- vim-lastplace \
- vim-spell \
- vim-ale \
- vim-prettier \
- vim-whitespace
+ vim-leader \
+ vim-shell \
+ vim-sensible \
+ vim-viminfo \
+ vim-lastplace \
+ vim-spell \
+ vim-ale \
+ vim-prettier \
+ vim-whitespace
# requires special hardware (mouse) or software (nerdfont)
webi \
- vim-gui \
- vim-nerdtree \
- nerdfont \
- vim-devicons
+ vim-gui \
+ vim-nerdtree \
+ nerdfont \
+ vim-devicons
if [ -n "$(command -v go)" ]; then
- webi vim-go
+ webi vim-go
fi
# done
curl -fsSL -o ~/.vim/plugins/devicons.vim "$WEBI_HOST/packages/vim-devicons/devicons.vim"
fi
- if ! grep 'source.*plugins.devicons.vim' -r ~/.vimrc >/dev/null 2>/dev/null; then
+ if ! grep 'source.*plugins.devicons.vim' -r ~/.vimrc > /dev/null 2> /dev/null; then
set +e
mkdir -p ~/.vim/plugins
printf '\n" devicons: reasonable defaults from webinstall.dev/vim-devicons\n' >> ~/.vimrc
webi \
- vim-leader \
- vim-shell \
- vim-sensible \
- vim-viminfo \
- vim-lastplace \
- vim-spell \
- vim-ale \
- vim-prettier \
- vim-whitespace \
- # done
+ 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'
curl -fsSL -o ~/.vim/plugins/lastplace.vim "$WEBI_HOST/packages/vim-lastplace/lastplace.vim"
fi
- if ! grep 'source.*plugins.lastplace.vim' -r ~/.vimrc >/dev/null 2>/dev/null; then
+ if ! grep 'source.*plugins.lastplace.vim' -r ~/.vimrc > /dev/null 2> /dev/null; then
set +e
mkdir -p ~/.vim/plugins
printf '\n" lastplace: explicit defaults from webinstall.dev/vim-lastplace\n' >> ~/.vimrc
curl -fsSL -o ~/.vim/plugins/nerdtree.vim "$WEBI_HOST/packages/vim-nerdtree/nerdtree.vim"
fi
- if ! grep 'source.*plugins.nerdtree.vim' -r ~/.vimrc >/dev/null 2>/dev/null; then
+ if ! grep 'source.*plugins.nerdtree.vim' -r ~/.vimrc > /dev/null 2> /dev/null; then
set +e
mkdir -p ~/.vim/plugins
printf '\n" NERDTree: reasonable defaults from webinstall.dev/vim-nerdtree\n' >> ~/.vimrc
git clone --depth=1 https://github.com/prettier/vim-prettier.git "$HOME/.vim/pack/plugins/start/vim-prettier"
if [ -z "$(command -v node)" ]; then
- export PATH="$HOME/.local/opt/node/bin:$HOME/.local/bin:${PATH}"
- webi node
+ export PATH="$HOME/.local/opt/node/bin:$HOME/.local/bin:${PATH}"
+ webi node
fi
npm install -g prettier@2
curl -fsSL -o ~/.vim/plugins/prettier.vim "$WEBI_HOST/packages/vim-prettier/prettier.vim"
fi
- if ! grep 'source.*plugins.prettier.vim' -r ~/.vimrc >/dev/null 2>/dev/null; then
+ if ! grep 'source.*plugins.prettier.vim' -r ~/.vimrc > /dev/null 2> /dev/null; then
set +e
mkdir -p ~/.vim/plugins
printf '\n" Prettier: reasonable defaults from webinstall.dev/vim-prettier\n' >> ~/.vimrc
git clone --depth=1 https://github.com/z0mbix/vim-shfmt.git "$HOME/.vim/pack/plugins/start/vim-shfmt"
if [ -z "$(command -v shfmt)" ]; then
- export PATH="$HOME/.local/bin:${PATH}"
- webi shfmt
+ export PATH="$HOME/.local/bin:${PATH}"
+ webi shfmt
fi
if [ ! -f "$HOME/.vimrc" ]; then
curl -fsSL -o ~/.vim/plugins/shfmt.vim "$WEBI_HOST/packages/vim-shfmt/shfmt.vim"
fi
- if ! grep 'source.*plugins.shfmt.vim' -r ~/.vimrc >/dev/null 2>/dev/null; then
+ if ! grep 'source.*plugins.shfmt.vim' -r ~/.vimrc > /dev/null 2> /dev/null; then
set +e
mkdir -p ~/.vim/plugins
printf '\n" shfmt: reasonable defaults from webinstall.dev/vim-shfmt\n' >> ~/.vimrc
my_size=${1:-$default_size}
if [ "0" != "$EUID" ] && [ "0" != "$UID" ]; then
- echo Usage:
- echo ' sudo env PATH="$PATH" vps-addswap' $my_size
- exit 1
+ echo Usage:
+ echo ' sudo env PATH="$PATH" vps-addswap' $my_size
+ exit 1
fi
if [ -f "/var/swapfile" ]; then
- swapoff /var/swapfile
+ swapoff /var/swapfile
fi
# Allocate a swapfile
# pkg_get_current_version is recommended, but (soon) not required
pkg_get_current_version() {
# 'watchexec --version' has output in this format:
- # watchexec 0.99.9
+ # watchexec 0.99.9
# This trims it down to just the version number:
# 0.99.9
- echo $(watchexec --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+ echo $(watchexec --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
{
-if [ -f "$HOME/.local/bin/webi" ]; then
- set +e
- cur_webi="$(command -v webi)"
- set -e
- if [ -z "$cur_webi" ]; then
- webi_path_add "$HOME/.local/bin"
- fi
- echo "Installed 'webi'"
-else
- # for when this file is run on its own, not from webinstall.dev
- echo "Install any other package via https://webinstall.dev and webi will be installed as part of the bootstrap process"
-fi
+ if [ -f "$HOME/.local/bin/webi" ]; then
+ set +e
+ cur_webi="$(command -v webi)"
+ set -e
+ if [ -z "$cur_webi" ]; then
+ webi_path_add "$HOME/.local/bin"
+ fi
+ echo "Installed 'webi'"
+ else
+ # for when this file is run on its own, not from webinstall.dev
+ echo "Install any other package via https://webinstall.dev and webi will be installed as part of the bootstrap process"
+ fi
}
# liblzma 5.2.5
# This trims it down to just the version number:
# 5.2.5
- echo $(xz --version 2>/dev/null | head -n 1 | cut -d ' ' -f 4)
+ echo $(xz --version 2> /dev/null | head -n 1 | cut -d ' ' -f 4)
}
}
}
pkg_get_current_version() {
- echo $(yq --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
+ echo $(yq --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
}
}