diff options
author | John Wiegley <johnw@newartisans.com> | 2009-03-08 15:29:27 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-03-08 16:09:33 -0400 |
commit | 7b2d75904c8f93cbec40bdc3905ba81f48f84853 (patch) | |
tree | 66810cfc85ec4f27bea3e3ecab470aa49d13b38a /tools/pre-commit | |
parent | db70bb1d044a867cd517728fdf03a1b12f27bbc8 (diff) | |
download | fork-ledger-7b2d75904c8f93cbec40bdc3905ba81f48f84853.tar.gz fork-ledger-7b2d75904c8f93cbec40bdc3905ba81f48f84853.tar.bz2 fork-ledger-7b2d75904c8f93cbec40bdc3905ba81f48f84853.zip |
Several improvements to how directories are chosen
Diffstat (limited to 'tools/pre-commit')
-rwxr-xr-x | tools/pre-commit | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/pre-commit b/tools/pre-commit index 3508958d..b04b895c 100755 --- a/tools/pre-commit +++ b/tools/pre-commit @@ -10,8 +10,18 @@ if [ $(git rev-parse --symbolic-full-name HEAD) = refs/heads/test ]; then fi # These are the locations I keep my temporary source and build trees in -TMPDIR=$HOME/Products/ledger-pre-commit -MIRROR=$HOME/Products/ledger-pre-commit-mirror +OUTPUT=$(tools/outdir) # generates a build directory name such as + # ~/Products/ledger +PRODUCTS=$(dirname "$OUTPUT") +BASE=$(basename "$OUTPUT") + +if [ -z "$BASE" ]; then + TMPDIR=$PWD/pre-commit + MIRROR=$PWD/pre-commit-mirror +else + TMPDIR=$PRODUCTS/$BASE-pre-commit + MIRROR=$PRODUCTS/$BASE-pre-commit-mirror +fi # Exit with status 1 if any command below fails set -e |