Skip to content

Commit 2cf5ea3

Browse files
committed
update run.sh to parse command-line options
1 parent a69bde7 commit 2cf5ea3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

run.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
function run.usage(){
4+
cat << EOF
5+
Run a script to build a portable Python environment in a container of the Docker image dclong/python-potable.
6+
7+
Syntax: ./run.sh [-h] env_example.sh
8+
-h: Print this help doc.
9+
env_example.sh: A shell script which installs Python packages and create a tar.gz archive from the portable Python environment.
10+
11+
EOF
12+
}
13+
14+
if [ "$#" -ne 1 ]; then
15+
echo "The script run.sh requires exactly 1 parameter! Please refe to the help doc below."
16+
echo
17+
run.usage
18+
exit 1
19+
fi
20+
21+
if [ "$1" == "-h" ]; then
22+
run.usage
23+
exit 0
24+
fi
25+
126
chmod +x "$1"
227
docker run \
328
--hostname python-portable \

0 commit comments

Comments
 (0)