mirror of
https://github.com/kremalicious/dotfiles.git
synced 2025-02-17 07:27:25 +01:00
shellcheck linting
This commit is contained in:
parent
ad12115f16
commit
4203456c2a
@ -22,7 +22,7 @@ declare -a dirs_to_append=(
|
|||||||
# Prepend directories to PATH
|
# Prepend directories to PATH
|
||||||
for index in ${!dirs_to_prepend[*]}
|
for index in ${!dirs_to_prepend[*]}
|
||||||
do
|
do
|
||||||
if [ -d ${dirs_to_prepend[$index]} ]; then
|
if [ -d "${dirs_to_prepend[$index]}" ]; then
|
||||||
# If these directories exist, then prepend them to existing PATH
|
# If these directories exist, then prepend them to existing PATH
|
||||||
PATH="${dirs_to_prepend[$index]}:$PATH"
|
PATH="${dirs_to_prepend[$index]}:$PATH"
|
||||||
fi
|
fi
|
||||||
@ -31,7 +31,7 @@ done
|
|||||||
# Append directories to PATH
|
# Append directories to PATH
|
||||||
for index in ${!dirs_to_append[*]}
|
for index in ${!dirs_to_append[*]}
|
||||||
do
|
do
|
||||||
if [ -d ${dirs_to_append[$index]} ]; then
|
if [ -d "${dirs_to_append[$index]}" ]; then
|
||||||
# If these bins exist, then append them to existing PATH
|
# If these bins exist, then append them to existing PATH
|
||||||
PATH="$PATH:${dirs_to_append[$index]}"
|
PATH="$PATH:${dirs_to_append[$index]}"
|
||||||
fi
|
fi
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# Load ~/.private, ~/.bash_prompt
|
# Load ~/.private, ~/.bash_prompt
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
for file in ~/.{bash_paths,bash_prompt,exports,aliases,inputrc,private}; do
|
for file in ~/.{exports,private,bash_paths,bash_prompt,aliases,inputrc}; do
|
||||||
[ -r "$file" ] && [ -f "$file" ] && source "$file"
|
[ -r "$file" ] && [ -f "$file" ] && source "$file"
|
||||||
done;
|
done;
|
||||||
unset file;
|
unset file;
|
||||||
|
@ -17,7 +17,7 @@ prompt_git() {
|
|||||||
local branchName='';
|
local branchName='';
|
||||||
|
|
||||||
# Check if the current directory is in a Git repository.
|
# Check if the current directory is in a Git repository.
|
||||||
if [ $(git rev-parse --is-inside-work-tree &>/dev/null; echo "${?}") == '0' ]; then
|
if [ "$(git rev-parse --is-inside-work-tree &>/dev/null; echo "${?}")" == '0' ]; then
|
||||||
|
|
||||||
# check if the current directory is in .git before running git checks
|
# check if the current directory is in .git before running git checks
|
||||||
if [ "$(git rev-parse --is-inside-git-dir 2> /dev/null)" == 'false' ]; then
|
if [ "$(git rev-parse --is-inside-git-dir 2> /dev/null)" == 'false' ]; then
|
||||||
|
@ -5,10 +5,10 @@ echo
|
|||||||
echo -e "$(tput bold) reg bld und tput-command-colors$(tput sgr0)"
|
echo -e "$(tput bold) reg bld und tput-command-colors$(tput sgr0)"
|
||||||
|
|
||||||
for i in $(seq 1 256); do
|
for i in $(seq 1 256); do
|
||||||
echo " $(tput setaf $i)Text$(tput sgr0) $(tput bold)$(tput setaf $i)Text$(tput sgr0) $(tput sgr 0 1)$(tput setaf $i)Text$(tput sgr0) \$(tput setaf $i)"
|
echo " $(tput setaf "$i")Text$(tput sgr0) $(tput bold)$(tput setaf "$i")Text$(tput sgr0) $(tput sgr 0 1)$(tput setaf "$i")Text$(tput sgr0) \$(tput setaf $i)"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo ' Bold $(tput bold)'
|
echo " Bold $(tput bold)"
|
||||||
echo ' Underline $(tput sgr 0 1)'
|
echo " Underline $(tput sgr 0 1)"
|
||||||
echo ' Reset $(tput sgr0)'
|
echo " Reset $(tput sgr0)"
|
||||||
echo
|
echo
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# give me /usr/local first
|
# give me /usr/local first
|
||||||
sudo chown -R $USER /usr/local
|
sudo chown -R "$USER" /usr/local
|
||||||
|
|
||||||
# Install Homebrew
|
# Install Homebrew
|
||||||
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
@ -18,7 +18,7 @@ brew install bash
|
|||||||
brew install bash-completion2
|
brew install bash-completion2
|
||||||
|
|
||||||
# Switch to using brew-installed bash as default shell
|
# Switch to using brew-installed bash as default shell
|
||||||
if ! fgrep -q '/usr/local/bin/bash' /etc/shells; then
|
if ! grep -F -q '/usr/local/bin/bash' /etc/shells; then
|
||||||
echo '/usr/local/bin/bash' | sudo tee -a /etc/shells;
|
echo '/usr/local/bin/bash' | sudo tee -a /etc/shells;
|
||||||
chsh -s /usr/local/bin/bash;
|
chsh -s /usr/local/bin/bash;
|
||||||
fi;
|
fi;
|
||||||
|
@ -31,7 +31,7 @@ touch private
|
|||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
for file in $files; do
|
for file in $files; do
|
||||||
ln -s $file ~/.$file
|
ln -s "$file" ~/."$file"
|
||||||
echo "$(tput setaf 64)✓$(tput sgr0) Created symlink to $(tput setaf 37)$file$(tput sgr0)"
|
echo "$(tput setaf 64)✓$(tput sgr0) Created symlink to $(tput setaf 37)$file$(tput sgr0)"
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -45,52 +45,52 @@ source ~/.bash_profile
|
|||||||
# Homebrew
|
# Homebrew
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
echo "$(tput setaf 136)"
|
"$(tput setaf 136)"
|
||||||
echo " Brewing all the things. "
|
echo " Brewing all the things. "
|
||||||
echo "============================================="
|
echo "============================================="
|
||||||
echo "$(tput sgr0)" # reset
|
"$(tput sgr0)" # reset
|
||||||
|
|
||||||
bin/install-brew.sh
|
bin/install-brew.sh
|
||||||
|
|
||||||
echo "$(tput setaf 64)" # green
|
"$(tput setaf 64)" # green
|
||||||
echo "---------------------------------------------"
|
echo "---------------------------------------------"
|
||||||
echo " ✓ done"
|
echo " ✓ done"
|
||||||
echo "$(tput sgr0)" # reset
|
"$(tput sgr0)" # reset
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# npm
|
# npm
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
echo "$(tput setaf 136)"
|
"$(tput setaf 136)"
|
||||||
echo " npm all the things. "
|
echo " npm all the things. "
|
||||||
echo "============================================="
|
echo "============================================="
|
||||||
echo "$(tput sgr0)" # reset
|
"$(tput sgr0)" # reset
|
||||||
|
|
||||||
bin/install-npm.sh
|
bin/install-npm.sh
|
||||||
|
|
||||||
echo "$(tput setaf 64)" # green
|
"$(tput setaf 64)" # green
|
||||||
echo "---------------------------------------------"
|
echo "---------------------------------------------"
|
||||||
echo " ✓ done"
|
echo " ✓ done"
|
||||||
echo "$(tput sgr0)" # reset
|
"$(tput sgr0)" # reset
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Ruby
|
# Ruby
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
echo "$(tput setaf 136)"
|
"$(tput setaf 136)"
|
||||||
echo " Ruby all the things. "
|
echo " Ruby all the things. "
|
||||||
echo "============================================="
|
echo "============================================="
|
||||||
echo "$(tput sgr0)" # reset
|
"$(tput sgr0)" # reset
|
||||||
|
|
||||||
bin/install-ruby.sh
|
bin/install-ruby.sh
|
||||||
|
|
||||||
echo "$(tput setaf 64)" # green
|
"$(tput setaf 64)" # green
|
||||||
echo "---------------------------------------------"
|
echo "---------------------------------------------"
|
||||||
echo " ✓ done"
|
echo " ✓ done"
|
||||||
echo "$(tput sgr0)" # reset
|
"$(tput sgr0)" # reset
|
||||||
|
|
||||||
echo "$(tput setaf 64)" # green
|
"$(tput setaf 64)" # green
|
||||||
echo "============================================="
|
echo "============================================="
|
||||||
echo " ✓ all done"
|
echo " ✓ all done"
|
||||||
echo "============================================="
|
echo "============================================="
|
||||||
echo "$(tput sgr0)" # reset
|
"$(tput sgr0)" # reset
|
||||||
|
@ -23,7 +23,7 @@ files="aliases bashrc bash_profile bash_paths bash_prompt editorconfig exports g
|
|||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
for file in $files; do
|
for file in $files; do
|
||||||
rm ~/.$file
|
rm ~/."$file"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ done
|
|||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
for file in $files; do
|
for file in $files; do
|
||||||
ln -s $file ~/.$file
|
ln -s "$file" ~/."$file"
|
||||||
echo "$(tput setaf 64)✓$(tput sgr0) Created symlink to $(tput setaf 37)$file$(tput sgr0)"
|
echo "$(tput setaf 64)✓$(tput sgr0) Created symlink to $(tput setaf 37)$file$(tput sgr0)"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
# macOS
|
# macOS
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
echo "$(tput setaf 136)"
|
"$(tput setaf 136)"
|
||||||
echo "Update macOS Apps "
|
echo "Update macOS Apps "
|
||||||
echo "------------------------------"
|
echo "------------------------------"
|
||||||
echo "$(tput sgr0)" # reset
|
"$(tput sgr0)" # reset
|
||||||
|
|
||||||
#sudo softwareupdate -i -a
|
#sudo softwareupdate -i -a
|
||||||
|
|
||||||
@ -18,10 +18,10 @@ mas upgrade
|
|||||||
# Homebrew
|
# Homebrew
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
echo "$(tput setaf 136)"
|
"$(tput setaf 136)"
|
||||||
echo "Update Homebrew "
|
echo "Update Homebrew "
|
||||||
echo "------------------------------"
|
echo "------------------------------"
|
||||||
echo "$(tput sgr0)" # reset
|
"$(tput sgr0)" # reset
|
||||||
|
|
||||||
brew update
|
brew update
|
||||||
brew upgrade
|
brew upgrade
|
||||||
@ -32,10 +32,10 @@ brew cleanup
|
|||||||
# npm
|
# npm
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
echo "$(tput setaf 136)"
|
"$(tput setaf 136)"
|
||||||
echo "Update npm "
|
echo "Update npm "
|
||||||
echo "------------------------------"
|
echo "------------------------------"
|
||||||
echo "$(tput sgr0)" # reset
|
"$(tput sgr0)" # reset
|
||||||
|
|
||||||
# update npm itself
|
# update npm itself
|
||||||
npm install npm -g
|
npm install npm -g
|
||||||
@ -47,10 +47,10 @@ npm update -g
|
|||||||
# Ruby
|
# Ruby
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
echo "$(tput setaf 136)"
|
"$(tput setaf 136)"
|
||||||
echo "Update rvm "
|
echo "Update rvm "
|
||||||
echo "------------------------------"
|
echo "------------------------------"
|
||||||
echo "$(tput sgr0)" # reset
|
"$(tput sgr0)" # reset
|
||||||
|
|
||||||
# update rvm itself
|
# update rvm itself
|
||||||
rvm get stable
|
rvm get stable
|
||||||
@ -66,14 +66,14 @@ rvm cleanup all
|
|||||||
# GPG
|
# GPG
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
echo "$(tput setaf 136)"
|
"$(tput setaf 136)"
|
||||||
echo "Refresh GPG keys "
|
echo "Refresh GPG keys "
|
||||||
echo "------------------------------"
|
echo "------------------------------"
|
||||||
echo "$(tput sgr0)" # reset
|
"$(tput sgr0)" # reset
|
||||||
|
|
||||||
gpg --refresh-keys
|
gpg --refresh-keys
|
||||||
|
|
||||||
echo "$(tput setaf 64)" # green
|
"$(tput setaf 64)" # green
|
||||||
echo "-------------------------------"
|
echo "-------------------------------"
|
||||||
echo " ✓ all done"
|
echo " ✓ all done"
|
||||||
echo "$(tput sgr0)" # reset
|
"$(tput sgr0)" # reset
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
updateRepo() {
|
updateRepo() {
|
||||||
local dir="$1"
|
local dir="$1"
|
||||||
local original_dir="$2"
|
local original_dir="$2"
|
||||||
cd $dir # switch to the git repo
|
cd "$dir" # switch to the git repo
|
||||||
repo_url=$(git config --get remote.origin.url)
|
repo_url=$(git config --get remote.origin.url)
|
||||||
|
|
||||||
echo "$(tput setaf 136)Updating Repo: $dir with url: $repo_url$(tput sgr0)"
|
echo "$(tput setaf 136)Updating Repo: $dir with url: $repo_url$(tput sgr0)"
|
||||||
|
4
exports
4
exports
@ -15,3 +15,7 @@ export LSCOLORS=gxfxcxdxbxegedabagacad
|
|||||||
export PIP_REQUIRE_VIRTUALENV=true
|
export PIP_REQUIRE_VIRTUALENV=true
|
||||||
# cache pip-installed packages to avoid re-downloading
|
# cache pip-installed packages to avoid re-downloading
|
||||||
export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache
|
export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache
|
||||||
|
|
||||||
|
# go
|
||||||
|
export GOPATH=$HOME/.go
|
||||||
|
export GOROOT=/usr/local/opt/go/libexec
|
Loading…
x
Reference in New Issue
Block a user