Skip to content

Commit

Permalink
actually use pipenv-shebang
Browse files Browse the repository at this point in the history
  • Loading branch information
thanodnl committed Aug 24, 2023
1 parent 5497ac6 commit ebaf5bb
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions citus_dev/citus_dev-pipenv
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
#!/usr/bin/env bash

# mostly copied from pipenv-shebang, but hardcoded for citus_dev
function getPipfile() {
DIR="$(dirname "$1")"
if [[ $DIR == "/" ]]; then exit; fi
PIPFILE="$DIR/Pipfile"
if [[ -e "$PIPFILE" ]]; then
echo "$PIPFILE"
else
getPipfile "$DIR"
fi
}

SCRIPT="$(realpath "$0")"
DIRNAME="$(dirname "$SCRIPT")"
PIPFILE=$(getPipfile "$SCRIPT")

if [[ -n "$PIPFILE" ]]; then
PIPENV_PIPFILE="$PIPFILE" exec pipenv run "${DIRNAME}/citus_dev" "$@"
else
echo "Could not locate the Pipfile for citus_dev."
exit 1
fi
realfile=$(realpath $0)
dir=$(dirname $realfile)
pipenv-shebang "${dir}/citus_dev" "$@"

0 comments on commit ebaf5bb

Please sign in to comment.