Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shell script to start sencha #434

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/bin/sh

while getopts "d" flag; do
case $flag in
d) # Handle the -d flag
# run docker
echo "Running in Docker..."
# run docker
docker run --rm -it -v `pwd`:/app --name sencha ghcr.io/bwbohl/sencha-cmd:latest /bin/bash -c "./build.sh testing; exit"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of hard coding the "testing" flag I suggest to read this from the initial command line arguments and pass it on to the Docker command

Suggested change
docker run --rm -it -v `pwd`:/app --name sencha ghcr.io/bwbohl/sencha-cmd:latest /bin/bash -c "./build.sh testing; exit"
shift $((OPTIND-1)) # remove -d from the list of input arguments
OPTIONS=${@} # set a variable OPTIONS with the remaining input arguments to pass to the build command.
# run docker
docker run --rm -it -v `pwd`:/app --name sencha ghcr.io/bwbohl/sencha-cmd:latest ./build.sh $OPTIONS"

With that you can also do e.g. ./build.sh -d production

Additionally, I removed the exit which is not needed imho

exit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not really needed, imho

Suggested change
exit

;;
\?)
# Handle invalid options
;;
esac
done


# cleaning the build dir
sencha ant clean

Expand All @@ -10,4 +26,7 @@ sencha app build $1
ant build-plus

# build xar
ant xar
ant xar

exit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the exit is not really needed?

Suggested change
exit