54 lines
1.6 KiB
Bash
Executable file
54 lines
1.6 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
|
|
echo "Working on $1".
|
|
|
|
build_str() {
|
|
dirout=~/tmp/ue_pe_web/intro_python
|
|
rm -rf $dirout
|
|
|
|
mkdir -p ${dirout}
|
|
mkdir -p ${dirout}/src/intro_python
|
|
mkdir -p ${dirout}/tests
|
|
|
|
cp .gitignore README.md pyproject.toml pdm.lock ${dirout}/
|
|
cp src/intro_python/__init__.py src/intro_python/intro_python.py ${dirout}/src/intro_python/
|
|
cp tests/test_intro_python.py ${dirout}/tests/
|
|
cd $dirout/..
|
|
zip student.zip -r intro_python/ -x "*.DS_Store"
|
|
cd -
|
|
}
|
|
|
|
if [ "$1" == "student" ]; then
|
|
echo "Setting up student configuration."
|
|
cp src/intro_python/intro_python{_student,}.py
|
|
cp tests/test_intro_python{_student,}.py
|
|
elif [ "$1" == "step_1" ]; then
|
|
echo "Setting up configuration for step 1."
|
|
cp src/intro_python/intro_python{_student_step_1,}.py
|
|
cp tests/test_intro_python{_student,}.py
|
|
elif [ "$1" == "step_2" ]; then
|
|
echo "Setting up configuration for step 2."
|
|
cp src/intro_python/intro_python{_student_step_1,}.py
|
|
cp tests/test_intro_python{_complete,}.py
|
|
elif [ "$1" == "complete" ]; then
|
|
echo "Setting up complete configuration."
|
|
cp src/intro_python/intro_python{_complete,}.py
|
|
cp tests/test_intro_python{_complete,}.py
|
|
elif [ "$1" == "reset" ]; then
|
|
echo "Reset exports."
|
|
rm src/intro_python/intro_python.py
|
|
rm tests/test_intro_python.py
|
|
else
|
|
echo "No keyword provided, please use reset, student or complete."
|
|
echo "Not doing anything."
|
|
fi
|
|
|
|
build_str
|
|
|
|
# Test script.
|
|
#pytest .
|
|
|
|
# Generate documentation from comments.
|
|
#pdoc ./intro_python.py ./test_intro_python.py -o out/
|