diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-04-09 10:12:35 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-04-09 10:12:35 +0100 |
commit | 99a052d4fa20cd3e29e5ff31d6793e3d3a96a017 (patch) | |
tree | f17c9737f150737c823a7bdf0630f0080d9a433c | |
parent | d901b8f4d8c422e4822c7a56bd579eb40a224dc2 (diff) | |
download | liw-automation-99a052d4fa20cd3e29e5ff31d6793e3d3a96a017.tar.gz |
Fix asd to also work with git.
-rwxr-xr-x | scripts/asd | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/scripts/asd b/scripts/asd index 4b42157..b9c01d2 100755 --- a/scripts/asd +++ b/scripts/asd @@ -1,6 +1,6 @@ #!/bin/sh # asd -- wrapper around sd -# Copyright 2010 Lars Wirzenius +# Copyright 2010, 2011 Lars Wirzenius # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,15 +26,26 @@ die() } +find_root() +{ + if bzr root > /dev/null 2>&1 + then + bzr root + elif git rev-parse --show-toplevel > /dev/null 2>&1 + then + git rev-parse --show-toplevel + else + die "Cannot find version control system root! Not bzr or git." + fi +} + + if [ "x$SD_REPO" = "x" ] then - if bzr root > /dev/null 2>&1 + root=$(find_root) + if [ -d "$root/../bugs" ] then - root=$(bzr root) - if [ -d "$root/../bugs" ] - then - export SD_REPO="$root/../bugs" - fi + export SD_REPO="$root/../bugs" fi if [ "x$SD_REPO" = "x" ] |