-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2fd6c61
commit 1f06366
Showing
8 changed files
with
88 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,6 @@ libtf-dl/ | |
|
||
# Generated from cabal.project.in | ||
cabal.project | ||
|
||
# Downloaded Bazel executable | ||
bazel511 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
tmpdir=$(mktemp -d) | ||
trap "rm -rf '$tmpdir'" EXIT | ||
|
||
if [[ $# -ge 2 && ( $1 = '-h' || $1 = '--help' ) ]]; then | ||
echo "Usage: $0 [name=path/to/target] -- command..." | ||
exit 0 | ||
fi | ||
|
||
while true; do | ||
arg=$1 | ||
shift | ||
|
||
if [[ $arg = '--' ]]; then | ||
break | ||
fi | ||
if ! echo "$arg" | grep -F '=' >/dev/null; then | ||
echo "$0: no '--' found before end of remapping list" | ||
exit 1 | ||
fi | ||
|
||
key=${arg%%=*} | ||
value=${arg#*=} | ||
if echo "$key" | grep -F '/' >/dev/null; then | ||
echo "$0: name cannot contain '/'" | ||
exit 1 | ||
fi | ||
if [[ -e "$tmpdir/$key" ]]; then | ||
echo "$0: duplicate name '$key'" | ||
exit 1 | ||
fi | ||
if echo "$value" | grep -F '/' >/dev/null; then | ||
ln -s "$(realpath "$value")" "$tmpdir/$key" | ||
else | ||
ln -s "$(which "$value")" "$tmpdir/$key" | ||
fi | ||
done | ||
|
||
env PATH="$tmpdir:$PATH" "$@" |