From b89a692c42e9a401cc931f4af2f11c5e5f6897b6 Mon Sep 17 00:00:00 2001 From: Gildas Cuisinier Date: Fri, 25 Jan 2013 21:47:33 +0100 Subject: [PATCH] replace file by symlink --- bin/jenv | 88 +------------------------------------------------------- 1 file changed, 1 insertion(+), 87 deletions(-) mode change 100755 => 120000 bin/jenv diff --git a/bin/jenv b/bin/jenv deleted file mode 100755 index 1803f73..0000000 --- a/bin/jenv +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env bash -set -e - -if [ "$1" = "--debug" ]; then - export JENV_DEBUG=1 - shift -fi - -if [ -n "$JENV_DEBUG" ]; then - export PS4='+ [${BASH_SOURCE##*/}:${LINENO}] ' - set -x -fi - -resolve_link() { - $(type -p greadlink readlink | head -1) "$1" -} - -abs_dirname() { - local cwd="$(pwd)" - local path="$1" - - while [ -n "$path" ]; do - cd "${path%/*}" - local name="${path##*/}" - path="$(resolve_link "$name" || true)" - done - - pwd - cd "$cwd" -} - -if [ -z "${JENV_ROOT}" ]; then - JENV_ROOT="${HOME}/.jenv" -else - JENV_ROOT="${JENV_ROOT%/}" -fi -export JENV_ROOT - -if [ -z "${JENV_DIR}" ]; then - JENV_DIR="$(pwd)" -else - cd "$JENV_DIR" 2>/dev/null || { - echo "jenv: cannot change working directory to \`$JENV_DIR'" - exit 1 - } >&2 - JENV_DIR="$(pwd)" - cd "$OLDPWD" -fi -export JENV_DIR - - -shopt -s nullglob - -bin_path="$(abs_dirname "$0")" -for plugin_bin in "${JENV_ROOT}/plugins/"*/bin; do - bin_path="${bin_path}:${plugin_bin}" -done -export PATH="${bin_path}:${PATH}" - -hook_path="${JENV_HOOK_PATH}:${JENV_ROOT}/jenv.d:/usr/local/etc/jenv.d:/etc/jenv.d:/usr/lib/jenv/hooks" -for plugin_hook in "${JENV_ROOT}/plugins/"*/etc/jenv.d; do - hook_path="${hook_path}:${plugin_hook}" -done -export JENV_HOOK_PATH="$hook_path" - -shopt -u nullglob - - -command="$1" -case "$command" in -"" | "-h" | "--help" ) - echo -e "$(jenv---version)\n$(jenv-help)" >&2 - ;; -"-v" ) - exec jenv---version - ;; -* ) - command_path="$(command -v "jenv-$command" || true)" - if [ -z "$command_path" ]; then - echo "jenv: no such command \`$command'" >&2 - exit 1 - fi - - shift 1 - exec "$command_path" "$@" - ;; -esac diff --git a/bin/jenv b/bin/jenv new file mode 120000 index 0000000..b938806 --- /dev/null +++ b/bin/jenv @@ -0,0 +1 @@ +../libexec/jenv \ No newline at end of file