From cbe7b47a9681b6ca1e542c47dc7026b39d27b3cb Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 14 Dec 2019 17:40:21 +0000 Subject: refactor(tools): __dispatch.sh now uses relative paths 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. --- third_party/default.nix | 1 + tools/bin/__dispatch.sh | 6 +++--- tools/bin/kms_pass | 1 + tools/bin/pass | 1 - 4 files changed, 5 insertions(+), 4 deletions(-) create mode 120000 tools/bin/kms_pass delete mode 120000 tools/bin/pass diff --git a/third_party/default.nix b/third_party/default.nix index 655f35b024..a02b05275f 100644 --- a/third_party/default.nix +++ b/third_party/default.nix @@ -61,6 +61,7 @@ let rustc sbcl stdenv + stern symlinkJoin terraform_0_12 tree diff --git a/tools/bin/__dispatch.sh b/tools/bin/__dispatch.sh index fb8a4d7791..d1d54909cb 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) diff --git a/tools/bin/kms_pass b/tools/bin/kms_pass new file mode 120000 index 0000000000..8390ec9c96 --- /dev/null +++ b/tools/bin/kms_pass @@ -0,0 +1 @@ +__dispatch.sh \ No newline at end of file diff --git a/tools/bin/pass b/tools/bin/pass deleted file mode 120000 index 8390ec9c96..0000000000 --- a/tools/bin/pass +++ /dev/null @@ -1 +0,0 @@ -__dispatch.sh \ No newline at end of file -- cgit 1.4.1