Created
September 24, 2024 21:45
-
-
Save gourytch/79123ffa6cf290b5a8a4e4f9ff715462 to your computer and use it in GitHub Desktop.
py3-venv wrapper around the gogrepoc script
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/bash | |
# required to work: | |
# sudo apt-get install -y python3-venv | |
# typical test scenario: | |
# ./gogrepoc login # login to GoG and get the auth token | |
# ./gogrepoc update # fetch information and create the manifest | |
# ./gogrepoc download -dryrun # get installers | |
# ./gogrepoc verify # check all the installers for consistency | |
base=$(dirname $(readlink -f $0)) | |
reqs="$base/requirements.txt" | |
venv="$base/gogrepoc-venv" | |
vbin="$venv/bin" | |
code="$venv/gogrepoc" | |
repo="https://github.com/Kalanyr/gogrepoc.git" | |
branch="dev" | |
# | |
# preparation part | |
# | |
[ ! -d "$reqs" ] || cat >$reqs <<'_EOF_' | |
html5lib | |
html2text | |
requests | |
pyOpenSSL | |
_EOF_ | |
if [ ! -d "$venv" ]; then | |
python3 -m venv "$venv" | |
"$vbin/python3" -m pip install --upgrade pip | |
"$vbin/python3" -m pip install -r "$reqs" | |
fi | |
[ -d "$code" ] || git clone -b "$branch" "$repo" "$code" | |
# | |
# do the work | |
# | |
source "$vbin/activate" | |
"$vbin/python3" "$code/gogrepoc.py" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment