Run single commands using ./pw cmd

This commit is contained in:
Matt McWilliams 2022-07-22 10:50:30 -04:00
parent 15fb1cc7af
commit b76765b10d
3 changed files with 5 additions and 4 deletions

View File

@ -4,14 +4,15 @@ help () {
echo "Usage: ./pw [command]" echo "Usage: ./pw [command]"
echo " " echo " "
echo "Commands:" echo "Commands:"
echo " build - Build the docker image with optional -f/--force" echo " build - Build the docker image with optional -f/--force"
echo " cmd - Run container with single command"
echo " compile - Run the compilation process" echo " compile - Run the compilation process"
} }
if [[ "${1}" == "build" ]]; then if [[ "${1}" == "build" ]]; then
bash ./scripts/build.sh "${2}" bash ./scripts/build.sh "${2}"
elif [[ "${1}" == "cmd" ]]; then elif [[ "${1}" == "cmd" ]]; then
bash ./scripts/cmd.sh ${@} bash ./scripts/cmd.sh "${2}"
elif [[ "${1}" == "compile" ]]; then elif [[ "${1}" == "compile" ]]; then
bash ./scripts/compile.sh bash ./scripts/compile.sh
else else

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
sudo docker run \ sudo docker run \
-v $PWD:/usr/src/build \ -v $PWD/compile_povray_wasm.sh:/usr/src/povray/compile_povray_wasm.sh \
povray_wasm \ povray_wasm \
sh -c 'cd /usr/src/povray && cp /usr/src/build/build.sh build.sh && bash build.sh' sh -c 'cd /usr/src/povray && bash compile_povray_wasm.sh'