From 08904631793015d17a72c4bb68f0393533e588e5 Mon Sep 17 00:00:00 2001 From: Ming Aldrich-Gan Date: Sat, 25 Sep 2021 00:20:16 -0500 Subject: [PATCH] Support args + remove deprecated virtualenv option 1. Forward command-line arguments to the Python script being installed, previously not supported. Tested with [CairoSVG](https://pypi.org/project/CairoSVG/), e.g. `cairosvg -h` no longer results in the error `cairosvg: error: the following arguments are required: input`. 2. Remove the `virtualenv --distribute` option, which has been deprecated in recent versions of `virtualenv`. Running `pip-app` no longer results in the error `virtualenv: error: unrecognized arguments: --distribute`. --- pip-app.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pip-app.sh b/pip-app.sh index 204bc61..b6f3a2c 100644 --- a/pip-app.sh +++ b/pip-app.sh @@ -14,7 +14,7 @@ pip-app () { fi # Create a new virtualenv - virtualenv --distribute "$@" "$venv_dir" + virtualenv "$@" "$venv_dir" # Executables present before installation. local execs_before="$(ls "$venv_dir/bin")" @@ -38,7 +38,7 @@ pip-app () { echo '#!/usr/bin/env bash' echo "# Generated by pip-app. For the app '$name'." echo "source '$venv_dir/bin/activate'" - echo "exec '$venv_dir/bin/$line'" + echo "exec '$venv_dir/bin/$line'" '"$@"' } > "$PIPAPP_DIR/bin/$line" chmod +x "$PIPAPP_DIR/bin/$line" done