Commit f3c3010f authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

pip-micropython: Revert to using PIP_MICROPY_DEST environment var.

-t/--target is a pip option. Trying to use pip options for different meanings
in pip-micropython may lead to big confusion. That's why the original passed
any extra parameters using environment variables. "All options belong to pip."
parent b427d6ae
...@@ -5,34 +5,19 @@ ...@@ -5,34 +5,19 @@
# complete library snapshot to be deployed on a device for baremetal # complete library snapshot to be deployed on a device for baremetal
# ports (if PIP_MICROPY_DEST environment var is set). # ports (if PIP_MICROPY_DEST environment var is set).
# #
# Currently supported usage:
#
# pip-micropython install [-t/--target <dir>] <packages>
# parse command
if [ "$1" != "install" ]; then if [ "$1" != "install" ]; then
echo "Only install command is supported currently" echo "Only install command is supported currently"
exit 1 exit 1
fi fi
shift shift
# parse options
targetdest=''
if [ "$1" == "-t" -o "$1" == "--target" ]; then
targetdest="$2"
shift
shift
fi
if [ -z "$TMPDIR" ]; then if [ -z "$TMPDIR" ]; then
TMPDIR=/tmp TMPDIR=/tmp
fi fi
TMPVENV="$TMPDIR/pip-micropy-venv" TMPVENV="$TMPDIR/pip-micropy-venv"
if [ -n "$targetdest" ]; then if [ -n "$PIP_MICROPY_DEST" ]; then
dest="$targetdest"
echo "Destination snapshot directory: $dest"
elif [ -n "$PIP_MICROPY_DEST" ]; then
dest="$PIP_MICROPY_DEST" dest="$PIP_MICROPY_DEST"
echo "Destination snapshot directory: $dest" echo "Destination snapshot directory: $dest"
elif [ -n "$MICROPYPATH" ]; then elif [ -n "$MICROPYPATH" ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment