I'm looking for feedback on improving the structure of this code. Also, I could not find the command line executable for Chrome.
General feedback is also requested.
#
#
#
# Divider - configures bash, git, grunt, sublime and chrome
#
#
#
user1=foo
config_bash() {
rm ~/.bash_profile
ln -s ~/root/config/bash/login.sh ~/.bash_profile
source ~/.bash_profile
echo "Bash configured."
}
config_git() {
local a="$1"
if [ $# -eq 0 ]
then
a="default"
fi
if [ $# -eq 1 ]
then
git config --global user.name "$a"
git config --global user.email "$a@$a.com"
fi
git config --global push.default matching
git config --global core.editor "subl"
git remote add godaddy [email protected]:~/root.git
git remote add heroku https://git.heroku.com/frozen-dusk-2587.git
echo "Git configured."
}
config_grunt() {
sudo npm install -g grunt-cli
mkdir ~/root_install/grunt
ln -s ~/root/config/grunt/package.json ~/root_install/grunt/package.json
ln -s ~/root/config/grunt/Gruntfile.js ~/root_install/grunt/Gruntfile.js
cd ~/root_install/grunt
npm install
cd ~/root
echo "Grunt configured."
}
config_sublime_2() {
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
rm -rf ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User
ln -s ~/root/config/sublime ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User
echo "Sublime configured."
}
reset_sublime_2() {
rm -rf ~/Library/Application\ Support/Sublime\ Text\ 2
}
config_chrome(){
chmod 0444 ~/Library/Application\ Support/Google/Chrome/Default/History
echo "Chrome configured."
}
config_all() {
config_bash
config_git
config_grunt
config_sublime_2
config_chrome
list
}
list(){
local a=$(which bash) b=$(which git) c=$(which grunt) d=$(which subl)
local g=$(which node) i=$(which heroku)
echo "****"
echo "Your bash executble is here: $a."
echo "Your git executble is here: $b."
echo "Your grunt executble is here: $c."
echo "Your sublime executble is here: $d."
echo "Your node executble is here: $g."
echo "Your heroku executble is here: $i."
echo "****"
}