Last active
July 6, 2023 03:47
-
-
Save ndgnuh/865c39882dc2ec58da566da171eb51d0 to your computer and use it in GitHub Desktop.
Create venv and install as app (for apps like labelme and gscreenshot)
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
#!/bin/sh | |
# Install venv first. | |
apppkg="$1" | |
appcmd="$2" | |
if [ -z "$apppkg" ]; then | |
echo "./mvenvapp.sh <apppkg> [appcmd]" | |
exit 1 | |
fi | |
if [ -z "$appcmd" ]; then | |
appcmd="$apppkg" | |
fi | |
envname="$appcmd" | |
python3 -m venv "$envname" | |
activate=$(realpath "$envname/bin/activate") | |
proxyfile="$HOME/.local/bin/$appcmd" | |
echo $envname | |
. $activate | |
pip install "$apppkg" | |
echo " | |
. $activate | |
$appcmd \$@ | |
" > "$proxyfile" | |
chmod 755 "$proxyfile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment