3 if [[ -z "${1}" ]]; then
4 if [[ -z "${PYVERSION}" ]]; then
7 export PYVER="${PYVERSION}"
13 #export PYTHONPATH="$(which python${PYVER})"
14 export PYTHONPATH="$(command -v python${PYVER})"
16 if [[ -z "${2}" ]]; then
18 outfilebin="${infile%.*}"
19 outfilezip="${infile%.*}.zip"
21 if [[ -f "./${2}" ]]; then
23 outfilebin="${infile%.*}"
24 outfilezip="${infile%.*}.zip"
27 outfilebin="${infile%.*}"
28 outfilezip="${infile%.*}.zip"
32 if ! [ -x "$(command -v python${PYVER})" ]; then
33 echo "Error: python${PYVER} is not installed." >&2
37 if [[ -f "./catfile.py" ]]; then
38 ${PYTHONPATH} ./catfile.py "${infile}"
42 mkdir -p -v /tmp/pybundle
43 cp -r -v ./${infile} /tmp/pybundle/__main__.py
44 cp -r -v ./pycatfile.py /tmp/pybundle/pycatfile.py
45 export OLDPATH="$(pwd)"
46 cd ./bundle/python${PYVER}
50 zip -v ./${outfilezip} -r .
51 echo '#!/usr/bin/env python'${PYVER} > ./${outfilebin}
52 echo '' >> ./${outfilebin}
53 cat ./${outfilezip} >> ./${outfilebin}
54 chmod -v +x ./${outfilebin}
56 mv -v /tmp/pybundle/${outfilebin} ./bundle/python${PYVER}/${outfilebin}
58 cd ./bundle/python${PYVER}
59 chmod -v +x ./${outfilebin}