-m cd $dir
-
-rev=$(cat $last_build 2>/dev/null) ||:
-head=$(git rev-parse HEAD)
-
-if ! $recompile && [[ $rev == "$head" ]]; then
- echo "already compiled, exiting"
- exit 0
+if [[ -e $dir ]]; then
+ m cd $dir
+ rev=$(cat $last_build 2>/dev/null) ||:
+ head=$(git rev-parse HEAD)
+ if ! $recompile && ! $bootstrap && [[ $rev == "$head" ]]; then
+ echo "already compiled, exiting"
+ exit 0
+ fi
+ if [[ $rev != "$head" ]]; then
+ bootstrap=true
+ fi
+else
+ m cd /a/opt/emacs
+ head=$(git rev-parse HEAD)
+ bootstrap=true