Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
shfmt all the things
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Jun 5, 2017
1 parent 509804a commit df4f1ed
Show file tree
Hide file tree
Showing 31 changed files with 263 additions and 268 deletions.
6 changes: 3 additions & 3 deletions antibody/install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
if which brew >/dev/null 2>&1; then
brew install getantibody/tap/antibody || brew upgrade antibody
brew install getantibody/tap/antibody || brew upgrade antibody
else
curl -sL https://git.io/antibody | sh -s
curl -sL https://git.io/antibody | sh -s
fi
antibody bundle < "$DOTFILES/antibody/bundles.txt" > ~/.zsh_plugins.sh
antibody bundle <"$DOTFILES/antibody/bundles.txt" >~/.zsh_plugins.sh
antibody update
26 changes: 13 additions & 13 deletions atom.symlink/install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
if test "$(which apm)"; then
apm upgrade --confirm false
apm upgrade --confirm false

modules="
modules="
atom-beautify
atom-wrap-in-tag
color-picker
Expand All @@ -20,19 +20,19 @@ if test "$(which apm)"; then
sort-lines
wakatime
"
for module in $modules; do
if test ! -d "$HOME/.atom/packages/$module"; then
apm install "$module"
fi
done
for module in $modules; do
if test ! -d "$HOME/.atom/packages/$module"; then
apm install "$module"
fi
done

modules="
modules="
metrics
exception-reporting
"
for module in $modules; do
if test -d "$HOME/.atom/packages/$module"; then
apm remove "$module"
fi
done
for module in $modules; do
if test -d "$HOME/.atom/packages/$module"; then
apm remove "$module"
fi
done
fi
4 changes: 2 additions & 2 deletions autoupdate/install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
# setups the auto-update
(
crontab -l | grep -v "dot_update"
echo "0 */2 * * * $HOME/.dotfiles/bin/dot_update > ${TMPDIRR:-/tmp}/dot_update.log 2>&1"
crontab -l | grep -v "dot_update"
echo "0 */2 * * * $HOME/.dotfiles/bin/dot_update > ${TMPDIRR:-/tmp}/dot_update.log 2>&1"
) | sort - | uniq - | crontab -
2 changes: 1 addition & 1 deletion aws/completion.zsh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
# shellcheck disable=SC1090
test -e /usr/local/bin/aws_zsh_completer.sh && . "$_"
test -e /usr/local/bin/aws_zsh_completer.sh && . "$_"
6 changes: 3 additions & 3 deletions bin/dot_update
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PATH="$(command -p getconf PATH):/usr/local/bin"

# ssh would not work under cron, add a https one
echo "› setting up update channel"
git remote add updates https://github.com/caarlos0/dotfiles.git 2> /dev/null
git remote add updates https://github.com/caarlos0/dotfiles.git 2>/dev/null

# Update repo
echo "› git update"
Expand All @@ -31,8 +31,8 @@ echo "› $DOTFILES/script/install"
"$DOTFILES/script/install"

if which antibody >/dev/null 2>&1; then
echo "› antibody update"
antibody update
echo "› antibody update"
antibody update
fi

echo "› registering last update"
Expand Down
2 changes: 1 addition & 1 deletion bin/e
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# $ e .
# $ e /usr/local
# # => opens the specified directory in your editor
exec "$EDITOR" "${1:-.}" > /tmp/editor-log 2>&1 &
exec "$EDITOR" "${1:-.}" >/tmp/editor-log 2>&1 &
2 changes: 1 addition & 1 deletion bin/kill-vpn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Kills viscosity and openvpn, as they constantly freeze on OSX for no reason
for p in openvpn viscosity; do
sudo pkill -9 -i -f "$p"
sudo pkill -9 -i -f "$p"
done
4 changes: 2 additions & 2 deletions bin/togif
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
set -eo pipefail
movie="$1"
rm -rf "$movie.gif"
ffmpeg -i "$movie" -vf "scale=800:-1" -pix_fmt rgb24 -r 10 -f gif - | \
gifsicle --optimize=3 --delay=3 > "$movie.gif"
ffmpeg -i "$movie" -vf "scale=800:-1" -pix_fmt rgb24 -r 10 -f gif - |
gifsicle --optimize=3 --delay=3 >"$movie.gif"
3 changes: 1 addition & 2 deletions bin/vip
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/sh
# open files from xargs in tabs and without messing up yout tty.
# example usage: git grep -c bash | cut -f1 -d':' | xargs vip
exec vim < /dev/tty -p "$@"

exec vim -p "$@" </dev/tty
18 changes: 9 additions & 9 deletions docker/install.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/sh
mkdir -p "$HOME/.docker/completions"

if which docker-compose > /dev/null 2>&1; then
curl -sL https://raw.githubusercontent.com/docker/compose/master/contrib/completion/zsh/_docker-compose \
-o "$HOME/.docker/completions/_docker-compose"
if which docker-compose >/dev/null 2>&1; then
curl -sL https://raw.githubusercontent.com/docker/compose/master/contrib/completion/zsh/_docker-compose \
-o "$HOME/.docker/completions/_docker-compose"
fi
if which docker-machine > /dev/null 2>&1; then
curl -sL https://raw.githubusercontent.com/docker/machine/master/contrib/completion/zsh/_docker-machine \
-o "$HOME/.docker/completions/_docker-machine"
if which docker-machine >/dev/null 2>&1; then
curl -sL https://raw.githubusercontent.com/docker/machine/master/contrib/completion/zsh/_docker-machine \
-o "$HOME/.docker/completions/_docker-machine"
fi
if which docker > /dev/null 2>&1; then
curl -sL https://raw.githubusercontent.com/docker/docker/master/contrib/completion/zsh/_docker \
-o "$HOME/.docker/completions/_docker"
if which docker >/dev/null 2>&1; then
curl -sL https://raw.githubusercontent.com/docker/docker/master/contrib/completion/zsh/_docker \
-o "$HOME/.docker/completions/_docker"
fi
20 changes: 10 additions & 10 deletions fonts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
URL="http://www.marksimonson.com/assets/content/fonts/AnonymousPro-1.002.zip"

install() {
curl -L -s -o /tmp/anon.tgz "$URL"
tar xzvf /tmp/anon.tgz -C /tmp
cp /tmp/AnonymousPro-1.002.001/*.ttf "$2"
curl -L -s -o /tmp/anon.tgz "$URL"
tar xzvf /tmp/anon.tgz -C /tmp
cp /tmp/AnonymousPro-1.002.001/*.ttf "$2"
}

if [ "$(uname -s)" = "Darwin" ]; then
if which brew >/dev/null 2>&1; then
brew cask install font-anonymous-pro
else
install ~/Library/Fonts
fi
if which brew >/dev/null 2>&1; then
brew cask install font-anonymous-pro
else
install ~/Library/Fonts
fi
else
mkdir -p ~/.fonts
install ~/.fonts
mkdir -p ~/.fonts
install ~/.fonts
fi
2 changes: 1 addition & 1 deletion git/aliases.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ alias gcb='git-copy-branch-name'
alias gpr='gp && git pr'

gi() {
curl -s "https://www.gitignore.io/api/$*";
curl -s "https://www.gitignore.io/api/$*"
}
8 changes: 4 additions & 4 deletions git/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

# Don't ask ssh password all the time
if [ "$(uname -s)" = "Darwin" ]; then
git config --global credential.helper osxkeychain
git config --global credential.helper osxkeychain
else
git config --global credential.helper cache
git config --global credential.helper cache
fi

# better diffs
if which diff-so-fancy > /dev/null 2>&1; then
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
if which diff-so-fancy >/dev/null 2>&1; then
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
fi
12 changes: 6 additions & 6 deletions golang/install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
if [ "$(which go)" ] && [ -n "$GOPATH" ]; then
mkdir -p "$GOPATH/bin" "$GOPATH/src/github.com/"
mkdir -p "$GOPATH/bin" "$GOPATH/src/github.com/"

packages="
packages="
github.com/alecthomas/gometalinter
golang.org/x/tools/cmd/cover
golang.org/x/tools/cmd/godoc
Expand All @@ -13,8 +13,8 @@ if [ "$(which go)" ] && [ -n "$GOPATH" ]; then
github.com/golang/lint/golint
"

for pkg in $packages; do
go get -u "$pkg"
done
"$GOPATH"/bin/gometalinter --install --update
for pkg in $packages; do
go get -u "$pkg"
done
"$GOPATH"/bin/gometalinter --install --update
fi
38 changes: 19 additions & 19 deletions homebrew/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#!/bin/sh
if which brew >/dev/null 2>&1; then
brew() {
case "$1" in
cleanup)
(cd "$(brew --repo)" && git prune && git gc)
command brew cleanup --force
command brew cask cleanup --force
command brew prune
rm -rf "$(brew --cache)"
;;
bump)
command brew update
command brew upgrade
brew cleanup
;;
*)
command brew "$@"
;;
esac
}
brew() {
case "$1" in
cleanup)
(cd "$(brew --repo)" && git prune && git gc)
command brew cleanup --force
command brew cask cleanup --force
command brew prune
rm -rf "$(brew --cache)"
;;
bump)
command brew update
command brew upgrade
brew cleanup
;;
*)
command brew "$@"
;;
esac
}
fi
2 changes: 1 addition & 1 deletion iterm/install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
[ "$(uname -s)" != "Darwin" ] && exit 0
sed "s;/Users/carlos;$HOME;g" \
"$DOTFILES"/iterm/com.googlecode.iterm2.plist.example > "$DOTFILES"/iterm/com.googlecode.iterm2.plist
"$DOTFILES"/iterm/com.googlecode.iterm2.plist.example >"$DOTFILES"/iterm/com.googlecode.iterm2.plist
defaults write com.googlecode.iterm2 "PrefsCustomFolder" -string "$DOTFILES/iterm"
defaults write com.googlecode.iterm2 "LoadPrefsFromCustomFolder" -bool true
12 changes: 6 additions & 6 deletions java/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh

mvn() {
# shellcheck disable=SC2068
command mvn $@
message="'mvn $*' done!"
which terminal-notifier > /dev/null && terminal-notifier -message "$message"
which notify-send > /dev/null && notify-send "$message"
# shellcheck disable=SC2068
command mvn $@
message="'mvn $*' done!"
which terminal-notifier >/dev/null && terminal-notifier -message "$message"
which notify-send >/dev/null && notify-send "$message"
}

alias mvnci='mvn clean install'
Expand All @@ -15,5 +15,5 @@ alias mvnag='mvn archetype:generate'
alias mvnnew='mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart'

killjboss() {
pkill -9 -f jboss-modules
pkill -9 -f jboss-modules
}
10 changes: 5 additions & 5 deletions kubernetes/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/sh

kubectl() {
# shellcheck disable=SC1090,SC2039
source <(command kubectl completion zsh)
command kubectl "$@"
# shellcheck disable=SC1090,SC2039
source <(command kubectl completion zsh)
command kubectl "$@"
}

kx() {
test -n "$1" && kubectl config use-context "$1"
test -z "$1" && kubectl config get-contexts
test -n "$1" && kubectl config use-context "$1"
test -z "$1" && kubectl config get-contexts
}

alias k='kubectl'
Expand Down
Loading

0 comments on commit df4f1ed

Please sign in to comment.