From ee698c5dc26b1ed0cc51cb7dfee4bf58953d66a2 Mon Sep 17 00:00:00 2001 From: Lars Kappert Date: Wed, 1 Jul 2015 10:35:09 +0200 Subject: [PATCH] Fixed some linting/compat issues --- bin/dotfiles | 7 ++++--- bin/plistbuddy | 2 ++ install/osx.sh | 2 +- osx/dock.sh | 6 +++--- runcom/.bash_profile | 8 ++++---- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/bin/dotfiles b/bin/dotfiles index 89d08b4b..dc521f6c 100755 --- a/bin/dotfiles +++ b/bin/dotfiles @@ -1,11 +1,12 @@ -#!/bin/sh +#!/usr/bin/env bash -BIN_NAME=$(basename $0) +BIN_NAME=$(basename "$0") COMMAND_NAME=$1 SUB_COMMAND_NAME=$2 sub_help () { - echo "Usage: $BIN_NAME \n" + echo "Usage: $BIN_NAME " + echo echo "Commands:" echo " help This help message" echo " edit Open dotfiles in default editor ($EDITOR) and Git GUI ($GIT_GUI)" diff --git a/bin/plistbuddy b/bin/plistbuddy index c1cae97e..fd1a933e 100755 --- a/bin/plistbuddy +++ b/bin/plistbuddy @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + PLIST=$1 ACTION=$2 KEY="$3" diff --git a/install/osx.sh b/install/osx.sh index a9cbbbf7..14b40387 100644 --- a/install/osx.sh +++ b/install/osx.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # Install Homebrew & brew-cask diff --git a/osx/dock.sh b/osx/dock.sh index 4a4fcb21..d4d1bf38 100644 --- a/osx/dock.sh +++ b/osx/dock.sh @@ -1,14 +1,14 @@ #!/bin/sh dockutil --no-restart --remove all -dockutil --no-restart --add "~/Applications/Google Chrome.app" -dockutil --no-restart --add "~/Applications/Firefox.app" +dockutil --no-restart --add "$HOME/Applications/Google Chrome.app" +dockutil --no-restart --add "$HOME/Applications/Firefox.app" dockutil --no-restart --add "/Applications/Safari.app" dockutil --no-restart --add "/Applications/Mail.app" dockutil --no-restart --add "/Applications/Calendar.app" dockutil --no-restart --add "/Applications/Utilities/Terminal.app" dockutil --no-restart --add "/Applications/System Preferences.app" dockutil --no-restart --add "/Applications/Utilities/Console.app" -dockutil --no-restart --add "~/Applications/Spotify.app" +dockutil --no-restart --add "$HOME/Applications/Spotify.app" killall Dock diff --git a/runcom/.bash_profile b/runcom/.bash_profile index d5098852..0ea1d793 100644 --- a/runcom/.bash_profile +++ b/runcom/.bash_profile @@ -17,7 +17,7 @@ fi if [ "$(uname -s)" = "Darwin" ]; then OS="OSX" else - OS=`uname -s` + OS=$(uname -s) fi # Resolve DOTFILES_DIR (assuming ~/.dotfiles on distros without readlink and/or $BASH_SOURCE/$0) @@ -31,7 +31,7 @@ fi if [[ -n $CURRENT_SCRIPT && -x "$READLINK" ]]; then SCRIPT_PATH=$($READLINK -f "$CURRENT_SCRIPT") - DOTFILES_DIR=$(dirname $(dirname "$SCRIPT_PATH")) + DOTFILES_DIR=$(dirname "$(dirname "$SCRIPT_PATH")") elif [ -d "$HOME/.dotfiles" ]; then DOTFILES_DIR="$HOME/.dotfiles" else @@ -45,7 +45,7 @@ for DOTFILE in "$DOTFILES_DIR"/system/.{function,path,env,alias,completion,grep, [ -f "$DOTFILE" ] && . "$DOTFILE" done -if [ $OS = "OSX" ]; then +if [ "$OS" = "OSX" ]; then for DOTFILE in "$DOTFILES_DIR"/system/.{env,alias,function}.osx; do [ -f "$DOTFILE" ] && . "$DOTFILE" done @@ -65,7 +65,7 @@ fi # Set LSCOLORS -eval $(dircolors $DOTFILES_DIR/system/.dir_colors) +eval "$(dircolors "$DOTFILES_DIR"/system/.dir_colors)" # Hook for extra/custom stuff