All @jonchang’s suggestions for py-venvs

Refs: https://github.com/teaxyz/pantry.extra/pull/93#issuecomment-1372917672
This commit is contained in:
Max Howell 2023-01-19 10:16:05 -05:00
parent 9d9621841a
commit 2d7c7a40c1
2 changed files with 8 additions and 19 deletions

View file

@ -17,28 +17,17 @@ cd "$PREFIX"
libexec/bin/pip install -v --no-binary :all: --ignore-installed $CMD_NAME
mkdir bin
mv libexec/bin/$CMD_NAME libexec/bin/teaxyz.py
cd bin
ln -s ../libexec/bin/$CMD_NAME $CMD_NAME
cd ../libexec/bin
fix-shebangs.ts *
cat <<EOF >$CMD_NAME
cat <<EOF >bin/$CMD_NAME
#!/usr/bin/env bash
self="\${BASH_SOURCE[0]}"
if test -L "\$self"; then
prefix="\$(dirname "\$self")"
suffix="\$(dirname \$(readlink \$self))"
LIBEXEC="\$(cd \$prefix/\$suffix && pwd)"
else
LIBEXEC="\$(cd "\$(dirname "\$self")" && pwd)"
fi
LIBEXEC="\$(cd "\$(dirname "\$self")"/../libexec/bin && pwd)"
source "\$LIBEXEC/activate"
exec "\$LIBEXEC"/teaxyz.py "\$@"
exec "\$LIBEXEC"/$CMD_NAME "\$@"
EOF
chmod +x $CMD_NAME
chmod +x bin/$CMD_NAME
cd libexec/bin
fix-shebangs.ts *
rm Activate.ps1 activate.csh activate.fish