about summary refs log tree commit diff
path: root/tools/bin/__dispatch.sh
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-14T17·40+0000
committerVincent Ambo <tazjin@google.com>2019-12-14T17·40+0000
commitcbe7b47a9681b6ca1e542c47dc7026b39d27b3cb (patch)
treeb863b95138fe5012a65e9751e6a297d2135b0325 /tools/bin/__dispatch.sh
parentf69dfbc40e0e8f3f1babfbed38cbbfb1eeb99057 (diff)
refactor(tools): __dispatch.sh now uses relative paths r/151
This enables usage of __dispatch.sh from anywhere, even outside of the
depot.

Specifically this means I can add `~/depot/bin` to my $PATH and all
the registered tools work from anywhere.
Diffstat (limited to 'tools/bin/__dispatch.sh')
-rwxr-xr-xtools/bin/__dispatch.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/bin/__dispatch.sh b/tools/bin/__dispatch.sh
index fb8a4d779185..d1d54909cbd6 100755
--- a/tools/bin/__dispatch.sh
+++ b/tools/bin/__dispatch.sh
@@ -6,7 +6,7 @@
 # to the key in nixpkgs which represents the program you want to run.
 set -ueo pipefail
 
-readonly REPO_ROOT=$(git rev-parse --show-toplevel)
+readonly REPO_ROOT=$(dirname $0)/../..
 readonly TARGET_TOOL=$(basename $0)
 
 case "${TARGET_TOOL}" in
@@ -20,9 +20,9 @@ case "${TARGET_TOOL}" in
     attr="tools.blog_cli"
     ;;
   stern)
-    attr="stern"
+    attr="third_party.stern"
     ;;
-  pass)
+  kms_pass)
     attr="tools.kms_pass"
     ;;
   aoc2019)