chore(script): apply shellcheck fixes

This commit is contained in:
Rob Watson 2023-10-07 10:43:32 +02:00
parent ff7d772d46
commit 6b78c20555
34 changed files with 102 additions and 238 deletions

View File

@ -4,8 +4,8 @@
set -e set -e
if [ $(uname -s) = "Darwin" ]; then if [ "$(uname -s)" = "Darwin" ]; then
echo "" # TODO echo "" # TODO
else # Linux else # Linux
echo "$(cat /sys/class/power_supply/BAT0/capacity)" cat /sys/class/power_supply/BAT0/capacity
fi fi

View File

@ -8,8 +8,7 @@ set -e
branchname=$(git bn) branchname=$(git bn)
if [ "$branchname" = "HEAD" ]; then if [ "$branchname" = "HEAD" ]; then
branchoutput=$(git branch --list | grep rebasing) if ! branchoutput=$(git branch --list | grep rebasing); then
if [ ! $? -eq 0 ]; then
exit 1 exit 1
fi fi
@ -21,4 +20,4 @@ if [ "$branchname" = "HEAD" ]; then
fi fi
fi fi
printf $branchname printf "%s" "$branchname"

View File

@ -9,11 +9,11 @@ set -e
pluginhome=$HOME/.vim/pack/git-plugins pluginhome=$HOME/.vim/pack/git-plugins
cd $pluginhome/opt cd "$pluginhome/opt"
find . -mindepth 1 -maxdepth 1 -type d -print0 | while read -d $'\0' pluginpath find . -mindepth 1 -maxdepth 1 -type d -print0 | while read -rd $'\0' pluginpath
do do
if ! grep -q "$pluginpath" $HOME/.config/nvim/init.vim ; then if ! grep -q "$pluginpath" "$HOME/.config/nvim/init.vim" ; then
basename=$(basename $pluginpath) basename=$(basename "$pluginpath")
echo "rm -rf $pluginhome/opt/$basename" echo "rm -rf $pluginhome/opt/$basename"
fi fi
done done

View File

@ -1,59 +0,0 @@
#!/usr/bin/env ruby
#
# frozen_string_literal: true
# Create a Git repo on git.netflux.io
require 'json'
require 'net/http'
require 'optparse'
require 'uri'
options = {}
banner = 'Usage: createrepo [options] <reponame>'
OptionParser.new do |opts|
opts.banner = banner
opts.on('--private', 'Make repo private') do |v|
options[:private] = v
end
opts.on('-d', '--description=DESC', 'Description') do |v|
options[:description] = v
end
end.parse!
options[:name] = ARGV.pop.to_s.strip
if options[:name].empty?
puts banner
exit 1
end
auth_token = ENV['GIT_NETFLUX_IO_TOKEN']
if !auth_token || auth_token.empty?
puts 'Env var GIT_NETFLUX_IO_TOKEN must be set'
exit 1
end
uri = URI('https://git.netflux.io/api/v1/user/repos')
auth_string = "token #{auth_token}"
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json', 'Authorization' => auth_string)
req.body = options.to_json
Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
resp = http.request(req)
if resp.code != '201'
begin
errmsg = JSON.parse(resp.body)
puts errmsg['message']
rescue JSON::ParserError
puts resp.body
end
exit 1
end
repo = JSON.parse(resp.body)
puts "git remote add origin #{repo['ssh_url']}"
end

View File

@ -26,7 +26,7 @@ if [ ! -d "$path" ]; then
exit 1 exit 1
fi fi
rm -rf $path rm -rf "$path"
echo "Deleted $basename" echo "Deleted $basename"

View File

@ -18,7 +18,7 @@ if [ -z "$filepattern" ]; then
filepattern="*" filepattern="*"
fi fi
if [ $(uname -s) = "Linux" ]; then if [ "$(uname -s)" = "Linux" ]; then
echo "TODO: fix for Linux" echo "TODO: fix for Linux"
fi fi

View File

@ -5,5 +5,5 @@
set -e set -e
ssh-keygen -o -a 100 -t ed25519 -f $HOME/.ssh/id_ed25519 -C "$USER@$(hostname -s)" ssh-keygen -o -a 100 -t ed25519 -f "$HOME/.ssh/id_ed25519" -C "$USER@$(hostname -s)"
cat $HOME/.ssh/id_ed25519.pub cat "$HOME/.ssh/id_ed25519.pub"

View File

@ -13,9 +13,9 @@ if ! echo "$ghoutput" | grep -q 'https://'; then
exit 1 exit 1
fi fi
url=$(echo $ghoutput | grep -o 'https://.*?' | tr -d '?') url=$(echo "$ghoutput" | grep -o 'https://.*?' | tr -d '?')
if [ $(uname -s) = "Linux" ]; then if [ "$(uname -s)" = "Linux" ]; then
progname="xdg-open" progname="xdg-open"
else else
progname="open" # macOS progname="open" # macOS

View File

@ -9,6 +9,7 @@ unset BROWSER
if [ "$1" = '-a' ]; then if [ "$1" = '-a' ]; then
cmd='gh pr list --limit 100' cmd='gh pr list --limit 100'
elif [ -z "$GITHUB_USERNAME" ]; then elif [ -z "$GITHUB_USERNAME" ]; then
# shellcheck disable=SC2016
echo 'set $GITHUB_USERNAME first' echo 'set $GITHUB_USERNAME first'
exit 1 exit 1
else else
@ -16,7 +17,7 @@ else
fi fi
prid=$(eval "$cmd" | fzf | awk '{print $1}') prid=$(eval "$cmd" | fzf | awk '{print $1}')
if [ -z $prid ]; then if [ -z "$prid" ]; then
exit 0 exit 0
fi fi
gh pr checkout $prid gh pr checkout "$prid"

View File

@ -22,6 +22,6 @@ if echo "$output" | grep -q "no pull requests found"; then
echo "Opening new PR..." echo "Opening new PR..."
gh pr create -w gh pr create -w
else else
echo $output echo "$output"
exit $exitcode exit $exitcode
fi fi

View File

@ -9,4 +9,4 @@ if [ "$1" = "-s" ]; then
fi fi
# TODO: fix for non-Darwin # TODO: fix for non-Darwin
git rev-parse $args HEAD | tr -d '\n' | pbcopy git rev-parse "$args" HEAD | tr -d '\n' | pbcopy

View File

@ -14,27 +14,27 @@ if ! [ -x "$(command -v cargo)" ]; then
exit 1 exit 1
fi fi
mkdir -p $HOME/dev $HOME/bin mkdir -p "$HOME/dev" "$HOME/bin"
destdir=$HOME/dev/alacritty destdir=$HOME/dev/alacritty
if [ -d $destdir ]; then if [ -d "$destdir" ]; then
echo "Updating alacritty..." echo "Updating alacritty..."
cd $destdir cd "$destdir"
git pull --rebase git pull --rebase
else else
echo "Cloning alacritty..." echo "Cloning alacritty..."
cd $HOME/dev cd "$HOME/dev"
git clone -q https://github.com/alacritty/alacritty.git alacritty git clone -q https://github.com/alacritty/alacritty.git alacritty
fi fi
cd $destdir cd "$destdir"
echo "Building alacritty..." echo "Building alacritty..."
if [ $(uname -s) = "Darwin" ]; then if [ "$(uname -s)" = "Darwin" ]; then
make app make app
sudo cp -av $destdir/target/release/osx/Alacritty.app /Applications/ sudo cp -av "$destdir/target/release/osx/Alacritty.app" /Applications/
else else
cargo build --release cargo build --release
echo "Installing alacritty..." echo "Installing alacritty..."
cp $destdir/target/release/alacritty $HOME/bin/alacritty cp "$destdir/target/release/alacritty" "$HOME/bin/alacritty"
fi fi
if [ -z "$ZDOTDIR" ]; then if [ -z "$ZDOTDIR" ]; then
@ -44,13 +44,13 @@ fi
echo "Installing ZSH completions..." echo "Installing ZSH completions..."
funcdir=$ZDOTDIR/functions funcdir=$ZDOTDIR/functions
mkdir -p $funcdir mkdir -p "$funcdir"
cp $destdir/extra/completions/_alacritty $funcdir/_alacritty cp "$destdir/extra/completions/_alacritty" "$funcdir/_alacritty"
if [ $(uname -s) = "Linux" ]; then if [ "$(uname -s)" = "Linux" ]; then
# TODO: fix for Manjaro/xfce4: # TODO: fix for Manjaro/xfce4:
sudo cp $destdir/extra/logo/alacritty-term.svg /usr/share/pixmaps/Alacritty.svg sudo cp "$destdir/extra/logo/alacritty-term.svg" /usr/share/pixmaps/Alacritty.svg
sudo desktop-file-install $destdir/extra/linux/Alacritty.desktop sudo desktop-file-install "$destdir/extra/linux/Alacritty.desktop"
sudo update-desktop-database sudo update-desktop-database
fi fi

View File

@ -6,47 +6,49 @@
set -e set -e
# General # General
mkdir -p $HOME/dev mkdir -p "$HOME/dev"
ln -sfn $HOME/dev/dotfiles/script $HOME/script ln -sfn "$HOME/dev/dotfiles/script" "$HOME/script"
# ZSH # ZSH
mkdir -p $HOME/.config/zsh/functions mkdir -p "$HOME/.config/zsh/functions"
# TODO: ZSH on Mac appears to load zshenv from ZDOTDIR, not HOME. # TODO: ZSH on Mac appears to load zshenv from ZDOTDIR, not HOME.
# Try to consolidate this. # Try to consolidate this.
if [ $(uname -s) = "Darwin" ]; then if [ "$(uname -s)" = "Darwin" ]; then
envpath="$HOME/.config/zsh/.zshenv" envpath="$HOME/.config/zsh/.zshenv"
else else
envpath="$HOME/.zshenv" envpath="$HOME/.zshenv"
fi fi
ln -sfn $HOME/dev/dotfiles/zshenv "$envpath" ln -sfn "$HOME/dev/dotfiles/zshenv" "$envpath"
ln -sfn $HOME/dev/dotfiles/zshrc $HOME/.config/zsh/.zshrc ln -sfn "$HOME/dev/dotfiles/zshrc" "$HOME/.config/zsh/.zshrc"
secretsfile="$HOME/.config/zsh/.zshsecrets" secretsfile="$HOME/.config/zsh/.zshsecrets"
if [ ! -f "$secretsfile" ]; then if [ ! -f "$secretsfile" ]; then
cp $HOME/dev/dotfiles/zshsecrets.example "$secretsfile" cp "$HOME/dev/dotfiles/zshsecrets.example" "$secretsfile"
fi fi
# Tmux # Tmux
ln -sfn $HOME/dev/dotfiles/tmux.conf $HOME/.tmux.conf ln -sfn "$HOME/dev/dotfiles/tmux.conf" "$HOME/.tmux.conf"
# Vim # Vim
mkdir -p $HOME/.vim/pack/git-plugins/{opt,start} mkdir -p "$HOME/.vim/pack/git-plugins/{opt,start}"
ln -sfn $HOME/dev/dotfiles/vimrc $HOME/.vimrc ln -sfn "$HOME/dev/dotfiles/vimrc" "$HOME/.vimrc"
ln -sfn $HOME/dev/dotfiles/vim/after $HOME/.vim/after ln -sfn "$HOME/dev/dotfiles/vim/after" "$HOME/.vim/after"
ln -sfn "$HOME/dev/dotfiles/vim/after" "$HOME/.vim/queries"
ln -sfn "$HOME/dev/dotfiles/vim/after" "$HOME/.vim/lua"
# Git # Git
ln -sfn $HOME/dev/dotfiles/gitconfig $HOME/.gitconfig ln -sfn "$HOME/dev/dotfiles/gitconfig" "$HOME/.gitconfig"
mkdir -p $HOME/.config/git mkdir -p "$HOME/.config/git"
ln -sfn $HOME/dev/dotfiles/gitignore $HOME/.config/git/ignore ln -sfn "$HOME/dev/dotfiles/gitignore" "$HOME/.config/git/ignore"
# Alacritty # Alacritty
if [ $(uname -s) = "Darwin" ]; then if [ "$(uname -s)" = "Darwin" ]; then
alacrittyconfig="$HOME/dev/dotfiles/alacritty.macos.yml" alacrittyconfig="$HOME/dev/dotfiles/alacritty.macos.yml"
else else
alacrittyconfig="$HOME/dev/dotfiles/alacritty.yml" alacrittyconfig="$HOME/dev/dotfiles/alacritty.yml"
fi fi
ln -sfn "$alacrittyconfig" $HOME/.config/alacritty.yml ln -sfn "$alacrittyconfig" "$HOME/.config/alacritty.yml"
echo "Done" echo "Done"

View File

@ -3,18 +3,18 @@
# Clone or update nvim to $HOME/dev/neovim, build and install to $HOME/local # Clone or update nvim to $HOME/dev/neovim, build and install to $HOME/local
set -e set -e
mkdir -p $HOME/dev mkdir -p "$HOME/dev"
destdir=$HOME/dev/neovim destdir=$HOME/dev/neovim
if [ -d $destdir ]; then if [ -d "$destdir" ]; then
echo "Updating nvim..." echo "Updating nvim..."
cd $destdir cd "$destdir"
git pull --rebase git pull --rebase
else else
echo "Cloning nvim..." echo "Cloning nvim..."
cd $HOME/dev cd "$HOME/dev"
git clone -q https://github.com/neovim/neovim.git neovim git clone -q https://github.com/neovim/neovim.git neovim
cd $destdir cd "$destdir"
fi fi
make CMAKE_BUILD_TYPE=Release CMAKE_INSTALL_PREFIX=$HOME/local make CMAKE_BUILD_TYPE=Release CMAKE_INSTALL_PREFIX="$HOME/local"
make install make install

View File

@ -2,7 +2,7 @@
# #
# install packages for a new arch or manjaro installation. requires sudo # install packages for a new arch or manjaro installation. requires sudo
if [[ $euid > 0 ]]; then if [[ $EUID -gt 0 ]]; then
echo "requires administrative privileges" echo "requires administrative privileges"
exit 1 exit 1
fi fi
@ -21,4 +21,4 @@ pacman -S --needed --noconfirm base-devel \
syncthing \ syncthing \
ttf-ubuntu-font-family # ubuntu mono font for alacritty ttf-ubuntu-font-family # ubuntu mono font for alacritty
sudo -u $SUDO_USER ./script/installpackagesnonroot sudo -u "$SUDO_USER" ./script/installpackagesnonroot

View File

@ -4,7 +4,8 @@
# https://rustup.rs/ # https://rustup.rs/
curl --proto '=https' --tlsv1.2 -ssf https://sh.rustup.rs | sh -s -- -y curl --proto '=https' --tlsv1.2 -ssf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env # shellcheck disable=SC1091
source "$HOME/.cargo/env"
# https://github.com/dandavison/delta#installation # https://github.com/dandavison/delta#installation
cargo install git-delta cargo install git-delta

View File

@ -1,28 +0,0 @@
#!/usr/bin/env bash
#
# Clone or update vim to $HOME/dev/vim, build and install to $HOME/local
set -e
mkdir -p $HOME/dev
destdir=$HOME/dev/vim
if [ -d $destdir ]; then
echo "Updating vim..."
cd $destdir
git pull --rebase
else
echo "Cloning vim..."
cd $HOME/dev
git clone -q https://github.com/vim/vim.git vim
fi
cd $destdir
# TODO: https://stackoverflow.com/questions/53135863/macos-mojave-ruby-config-h-file-not-found
opts="--enable-luainterp --enable-python3interp --with-features=huge --enable-multibyte --enable-gui=gtk2"
if [ ! $(uname -s) = "Darwin" ]; then
opts="$opts --with-rubyinterp --with-x"
fi
./configure --prefix=$HOME/local $opts
make -j6
make install

View File

@ -7,18 +7,18 @@ set -e
# Note: not currently updated automatically by `updatevimplugins` # Note: not currently updated automatically by `updatevimplugins`
url="https://raw.githubusercontent.com/junegunn/fzf/master/plugin/fzf.vim" url="https://raw.githubusercontent.com/junegunn/fzf/master/plugin/fzf.vim"
echo "Fetching $url..." echo "Fetching $url..."
mkdir -p $HOME/.vim/plugin mkdir -p "$HOME/.vim/plugin"
curl -sL -o $HOME/.vim/plugin/fzf.vim https://raw.githubusercontent.com/junegunn/fzf/master/plugin/fzf.vim curl -sL -o "$HOME/.vim/plugin/fzf.vim" https://raw.githubusercontent.com/junegunn/fzf/master/plugin/fzf.vim
# Relies on vimrc containing lines e.g.: # Relies on vimrc containing lines e.g.:
# packadd! rust.vim " https://github.com/rust-lang/rust.vim.git # packadd! rust.vim " https://github.com/rust-lang/rust.vim.git
pluginhome=$HOME/.vim/pack/git-plugins/opt pluginhome=$HOME/.vim/pack/git-plugins/opt
mkdir -p $pluginhome mkdir -p "$pluginhome"
cd $pluginhome cd "$pluginhome"
grep packadd! $HOME/.config/nvim/init.vim | grep -o 'https.*$' | while read -r url ; do grep packadd! "$HOME/.config/nvim/init.vim" | grep -o 'https.*$' | while read -r url ; do
dirname=$(basename $url .git) dirname=$(basename "$url" .git)
if [ -d "$dirname" ]; then if [ -d "$dirname" ]; then
echo "Exists: $dirname" echo "Exists: $dirname"
else else

View File

@ -5,12 +5,12 @@
set -e set -e
if [ -z "$JIRADOMAIN" ]; then if [ -z "$JIRADOMAIN" ]; then
# shellcheck disable=SC2016
echo 'set $JIRADOMAIN first' echo 'set $JIRADOMAIN first'
exit 1 exit 1
fi fi
branchname="$(branchname)" if ! branchname="$(branchname)"; then
if [ ! $? -eq 0 ]; then
echo "branchname returned exit code: $?" echo "branchname returned exit code: $?"
exit 1 exit 1
fi fi
@ -21,11 +21,10 @@ if ! echo "$branchname" | grep -q "/"; then
fi fi
ticket=$(echo "$branchname" | cut -d "/" -f1 | tr '[:lower:]' '[:upper:]') ticket=$(echo "$branchname" | cut -d "/" -f1 | tr '[:lower:]' '[:upper:]')
url="$JIRADOMAIN/browse/$ticket" url="$JIRADOMAIN/browse/$ticket"
if [ "$1" == "-b" ]; then if [ "$1" == "-b" ]; then
if [ $(uname -s) = "Linux" ]; then if [ "$(uname -s)" = "Linux" ]; then
progname="xdg-open" progname="xdg-open"
else else
progname="open" # macOS progname="open" # macOS
@ -35,4 +34,4 @@ if [ "$1" == "-b" ]; then
exit $? exit $?
fi fi
printf $url printf "%s" "$url"

View File

@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
context=$(kubectl config get-contexts -o name | fzf) if ! context=$(kubectl config get-contexts -o name | fzf); then
if [ $? -ne 0 ]; then
exit $? exit $?
fi fi

View File

@ -7,11 +7,11 @@ set -e
url='https://api.ipify.org?format=text' url='https://api.ipify.org?format=text'
if [ "$1" = "-c" ]; then if [ "$1" = "-c" ]; then
if [ $(uname -s) = "Darwin" ]; then if [ "$(uname -s)" = "Darwin" ]; then
curl -s $url | pbcopy curl -s "$url" | pbcopy
else else
curl -s $url | xclip -i curl -s "$url" | xclip -i
fi fi
else else
curl -s $url curl -s "$url"
fi fi

View File

@ -4,7 +4,7 @@
set -e set -e
if [ $(uname -s) = "Darwin" ]; then if [ "$(uname -s)" = "Darwin" ]; then
uptime | grep -o "[0-9]\+\.[0-9]\+ [0-9]\+\.[0-9]\+ [0-9]\+\.[0-9]\+" uptime | grep -o "[0-9]\+\.[0-9]\+ [0-9]\+\.[0-9]\+ [0-9]\+\.[0-9]\+"
else # Linux else # Linux
cut -d " " -f 1-3 /proc/loadavg cut -d " " -f 1-3 /proc/loadavg

View File

@ -9,17 +9,17 @@ set -e
if [ -z "$1" ]; then if [ -z "$1" ]; then
cwd=$(pwd) cwd=$(pwd)
sessionname=$(basename $cwd) sessionname=$(basename "$cwd")
else else
sessionname="$1" sessionname="$1"
fi fi
tmux_new_result=$(tmux new -d -s $sessionname 2>&1) || true tmux_new_result=$(tmux new -d -s "$sessionname" 2>&1) || true
exitcode=$? exitcode=$?
if echo "$tmux_new_result" | grep -q "duplicate session"; then if echo "$tmux_new_result" | grep -q "duplicate session"; then
echo "Session $sessionname already exists. Attaching..." echo "Session $sessionname already exists. Attaching..."
tmux new -d -A -s $sessionname tmux new -d -A -s "$sessionname"
exit 0 exit 0
fi fi
@ -29,9 +29,9 @@ if [ $exitcode -ne 0 ]; then
fi fi
# TODO: fix sessionname containing full stop which are renamed by tmux # TODO: fix sessionname containing full stop which are renamed by tmux
tmux rename-window -t $sessionname:1 cli tmux rename-window -t "$sessionname:1" cli
tmux new-window -t $sessionname -n vim zsh -ic nvim tmux new-window -t "$sessionname" -n vim zsh -ic nvim
tmux select-window -t $sessionname:1 tmux select-window -t "$sessionname:1"
# https://github.com/tmux/tmux/issues/2064 # https://github.com/tmux/tmux/issues/2064
sleep 0.5 sleep 0.5
tmux attach -t $sessionname tmux attach -t "$sessionname"

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
#
# Unstage a branch
set -e
branch=$(git rev-parse --abbrev-ref HEAD)
if [ -z "$1" ]; then
basebranch="master"
else
basebranch="$1"
fi
diff=$(git diff $basebranch...HEAD)
git co -q "$basebranch"
echo "$diff" | git apply
echo "Unstaged $branch against $basebranch successfully"
git diff --shortstat "HEAD...$branch"

View File

@ -2,7 +2,9 @@
# #
# Update all AUR packages in $HOME/pkg # Update all AUR packages in $HOME/pkg
find $HOME/pkg -mindepth 1 -maxdepth 1 -type d -print0 | while read -d $'\0' pkgdir set -euo pipefail
find "$HOME/pkg" -mindepth 1 -maxdepth 1 -type d -print0 | while read -rd $'\0' pkgdir
do do
cd "$pkgdir" cd "$pkgdir"
pullres=$(git pull --rebase) pullres=$(git pull --rebase)

View File

@ -12,8 +12,10 @@ updatenvim
updatevimplugins updatevimplugins
echo "Installing gopls..." echo "Installing gopls..."
cd $HOME cd "$HOME"
go install golang.org/x/tools/gopls@latest go install golang.org/x/tools/gopls@latest
go install honnef.co/go/tools/cmd/staticcheck@latest go install honnef.co/go/tools/cmd/staticcheck@latest
# TODO: run installdotfiles?
echo "Done" echo "Done"

View File

@ -1,27 +0,0 @@
#!/usr/bin/env bash
#
# Build and push Invidious
#
# TODO: remove Docker hub, push with SSH.
set -e
destdir=$HOME/dev/invidious
image=netfluxio/invidious:latest
remotehost=netflux
if [ ! -d $destdir ]; then
echo "Cloning invidious..."
cd $HOME/dev
git clone -q --depth=1 https://github.com/iv-org/invidious.git invidious
else
echo "Updating invidious..."
cd $destdir
git pull --rebase
fi
cd $destdir
docker build -t $image -f docker/Dockerfile .
docker push $image
ssh $remotehost 'cd dev/netflux-internals && docker-compose pull invidious && docker-compose up -d --force-recreate --no-deps invidious'

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
#
# updatenetflux - pull and restart containers on remote server
set -e
remotehost=netflux
ssh $remotehost 'cd dev/netflux-internals && git pull --rebase && docker-compose down -v && docker-compose pull && docker-compose up -d --force-recreate'
# invidious requires a local build, managed by a separate script.
updateinvidious

View File

@ -1 +0,0 @@
installvim

View File

@ -5,13 +5,13 @@
set -e set -e
pluginhome=$HOME/.vim/pack/git-plugins pluginhome=$HOME/.vim/pack/git-plugins
cd $pluginhome cd "$pluginhome"
find . -mindepth 2 -maxdepth 2 -type d -print0 | while read -d $'\0' pluginpath find . -mindepth 2 -maxdepth 2 -type d -print0 | while read -rd $'\0' pluginpath
do do
cd $pluginpath cd "$pluginpath"
basename=$(basename $pluginpath) basename=$(basename "$pluginpath")
printf "In $basename.. " printf "In %s.. " "$basename"
git pull --rebase git pull --rebase
cd $pluginhome cd "$pluginhome"
done done

View File

@ -2,4 +2,6 @@
# #
# uuidprint - generate and print a lower-case UUID v4 # uuidprint - generate and print a lower-case UUID v4
set -e
uuidgen | tr '[:upper:]' '[:lower:]' | tr -d '\n' uuidgen | tr '[:upper:]' '[:lower:]' | tr -d '\n'

View File

@ -2,5 +2,7 @@
# #
# uuidyank - generate and copy a lower-case UUID v4 # uuidyank - generate and copy a lower-case UUID v4
set -e
# TODO: fix for Linux # TODO: fix for Linux
uuidprint | pbcopy uuidprint | pbcopy

View File

@ -4,7 +4,7 @@
set -e set -e
if [[ $EUID > 0 ]]; then if [[ $EUID -gt 0 ]]; then
echo "requires administrative privileges" echo "requires administrative privileges"
exit 1 exit 1
fi fi

View File

@ -4,7 +4,7 @@
set -e set -e
if [[ $EUID > 0 ]]; then if [[ $EUID -gt 0 ]]; then
echo "requires administrative privileges" echo "requires administrative privileges"
exit 1 exit 1
fi fi