My bash profile
8 August, 2012 § 1 Comment
While working on Firefox you end up using the terminal a lot. The most common things I do with my terminal are to perform an incremental rebuild of Firefox and to run Firefox
Here’s the relevant portion of my bash profile:
alias beep='echo -en "\007"'
alias beep2='beep && beep'
alias beep4='beep2 && beep2'
alias beep8='beep4 && beep4'
alias beep16='beep8 && beep8'
alias beep32='beep16 && beep16'
alias fx='dist/bin/firefox.exe -P clean -no-remote'
alias fn=dist/bin/fennec.exe
alias clobber='autoconf-2.13 && pushd js/src && autoconf-2.13 && pushd ../../obj-dir && ../configure && python -O "../build/pymake/make.py" -s -j12 && popd && popd && beep32'
mk() {
last=${!#};
for folder in "$@"; do
make -sC $folder -j4
RESULT=$?
if [ $RESULT -gt 0 ]; then
echo Error making $folder
return $RESULT
else
echo Made $folder
fi
done
}
Clobber builds (rebuilding the whole platform and browser) on Windows can take a really long time to complete, so I have my clobber builds make an obnoxious amount of beeps (32) when they complete.
I use Firefox as my default browser while working, so I use a separate profile for my local build (“clean”). I wipe this profile often, hence the “clean” name. By typing fx in my terminal, it runs Firefox in the default location (relative to my object directory), and passes the necessary arguments so it doesn’t conflict with my already running instance of Firefox.
The mk function that I have allows me to chain many folders together for a build and reduces the amount of typing I have to do. If I make some changes to the Firefox theme and the browser frontend, I can just type: mk browser/themes browser/base && fx to rebuild the necessary folders and then run Firefox.
So that’s it for my bash profile, it’s admittedly pretty small. Take a look at Paul Rouget’s .vimrc for some more awesome commands.
I prefer to use client.mk; it keeps my configures up-to-date, it works with {pymake} -f ../client.mk and you get to add your MOZ_MAKE_FLAGS to your .mozconfig too.