mirror of https://github.com/jenv/jenv.git
9 changed files with 74 additions and 60 deletions
@ -1,23 +0,0 @@
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env bash |
||||
# |
||||
# `ruby-local-exec` is a drop-in replacement for the standard Ruby |
||||
# shebang line: |
||||
# |
||||
# #!/usr/bin/env ruby-local-exec |
||||
# |
||||
# Use it for scripts inside a project with an `.jenv-version` |
||||
# file. When you run the scripts, they'll use the project-specified |
||||
# Ruby version, regardless of what directory they're run from. Useful |
||||
# for e.g. running project tasks in cron scripts without needing to |
||||
# `cd` into the project first. |
||||
|
||||
set -e |
||||
export JENV_DIR="${1%/*}" |
||||
|
||||
[ -n "$JENV_SILENCE_WARNINGS" ] || { |
||||
echo "jenv: \`ruby-local-exec' is deprecated and will be removed in the next release." |
||||
echo " To upgrade: https://github.com/sstephenson/jenv/wiki/ruby-local-exec" |
||||
echo |
||||
} >&2 |
||||
|
||||
exec ruby "$@" |
||||
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
echo "Before Ant" |
||||
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
backuppath=$PATH |
||||
|
||||
PATH="$(remove_from_path "${JENV_ROOT}/shims")" |
||||
ANT_BIN="$(command -v "ant" || true)" |
||||
|
||||
PATH=$backuppath |
||||
|
||||
#echo "make shims $MAVEN_BIN" |
||||
make_shims "$ANT_BIN" |
||||
|
||||
|
||||
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
echo "Before Gradle" |
||||
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
backuppath=$PATH |
||||
|
||||
PATH="$(remove_from_path "${JENV_ROOT}/shims")" |
||||
GRADLE_BIN="$(command -v "gradle" || true)" |
||||
|
||||
PATH=$backuppath |
||||
|
||||
#echo "make shims $MAVEN_BIN" |
||||
make_shims "$GRADLE_BIN" |
||||
|
||||
|
||||
@ -1 +1 @@
@@ -1 +1 @@
|
||||
echo "Before execute $1 $2" |
||||
echo "Before maven" |
||||
@ -1,43 +1,14 @@
@@ -1,43 +1,14 @@
|
||||
remove_from_path() { |
||||
local path_to_remove="$(expand_path "$1")" |
||||
local result="" |
||||
|
||||
if [ -z "$path_to_remove" ]; then |
||||
echo "${PATH}" |
||||
return |
||||
fi |
||||
|
||||
local paths |
||||
IFS=: paths=($PATH) |
||||
|
||||
for path in "${paths[@]}"; do |
||||
path="$(expand_path "$path" || true)" |
||||
if [ -n "$path" ] && [ "$path" != "$path_to_remove" ]; then |
||||
result="${result}${path}:" |
||||
fi |
||||
done |
||||
|
||||
echo "${result%:}" |
||||
} |
||||
|
||||
expand_path() { |
||||
if [ ! -d "$1" ]; then |
||||
return 1 |
||||
fi |
||||
|
||||
local cwd="$(pwd)" |
||||
cd "$1" |
||||
pwd |
||||
cd "$cwd" |
||||
} |
||||
|
||||
|
||||
backuppath=$PATH |
||||
|
||||
PATH="$(remove_from_path "${JENV_ROOT}/shims")" |
||||
MAVEN_BIN="$(command -v "mvn" || true)" |
||||
MAVEN_DEBUG="$(command -v "mvnDebug" || true)" |
||||
|
||||
|
||||
PATH=$backuppath |
||||
|
||||
#echo "make shims $MAVEN_BIN" |
||||
make_shims "$MAVEN_BIN" |
||||
|
||||
|
||||
|
||||
Loading…
Reference in new issue