Make scripts work when run from other directories.

time-shift
Sébastien Villemot 2014-07-31 15:45:15 +02:00
parent 1d3bca8ad3
commit dd1e19ca36
2 changed files with 7 additions and 4 deletions

View File

@ -7,7 +7,9 @@ if [ -z "$1" ]; then
exit 1
fi
SCRIPTS_DIR=$(dirname $0)
SCRIPTS_DIR=$(pwd)/$(dirname $0)
uncrustify -l CPP --replace -c ${SCRIPTS_DIR}/uncrustify.cfg $1
emacs -batch $1 -l ${SCRIPTS_DIR}/indent-c++.el
cd $(dirname $1)
emacs -batch $(basename $1) -l ${SCRIPTS_DIR}/indent-c++.el

View File

@ -7,6 +7,7 @@ if [ -z "$1" ]; then
exit 1
fi
SCRIPTS_DIR=$(dirname $0)
SCRIPTS_DIR=$(pwd)/$(dirname $0)
emacs -batch $1 -l ${SCRIPTS_DIR}/indent-matlab.el
cd $(dirname $1)
emacs -batch $(basename $1) -l ${SCRIPTS_DIR}/indent-matlab.el