Skip to content

Commit d84e745

Browse files
committed
Make ripunzip installer accessible from outside this repo.
* The relative path to misc doesn't work when running from another repo * The buildifier dependency is not available from other repos, therefore we can't pull in //misc/bazel without further refactoring. Therefore, inline the runfiles snippet here.
1 parent 20d9fd1 commit d84e745

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

misc/ripunzip/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ sh_binary(
99
srcs = ["install.sh"],
1010
args = ["$(rlocationpath :ripunzip)"],
1111
data = [":ripunzip"],
12-
deps = ["//misc/bazel:sh_runfiles"],
12+
deps = ["@bazel_tools//tools/bash/runfiles"],
1313
)

misc/ripunzip/install.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
set -eu
44

5-
. misc/bazel/runfiles.sh
5+
# --- begin runfiles.bash initialization v3 ---
6+
# Copy-pasted from the Bazel Bash runfiles library v3.
7+
set -uo pipefail; set +e; f=bazel_tools/tools/bash/runfiles/runfiles.bash
8+
source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
9+
source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \
10+
source "$0.runfiles/$f" 2>/dev/null || \
11+
source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
12+
source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
13+
{ echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e
14+
# --- end runfiles.bash initialization v3 ---
615

716
dest="${2:-$HOME/.local/bin}"
817

0 commit comments

Comments
 (0)