mirror of
https://github.com/bensuperpc/dockcross.git
synced 2025-01-05 14:44:26 +01:00
Merge pull request #35 from jcfr/34-add-support-for-special-update-commands
34 add support for special update commands
This commit is contained in:
commit
72ffa6dd1d
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DEFAULT_DOCKCROSS_IMAGE=dockcross/base
|
DEFAULT_DOCKCROSS_IMAGE=dockcross/base # DO NOT MOVE THIS LINE (see entrypoint.sh)
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Helpers
|
# Helpers
|
||||||
@ -93,6 +93,7 @@ ENDHELP
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Option processing
|
# Option processing
|
||||||
#
|
#
|
||||||
|
special_update_command=''
|
||||||
while [[ $# != 0 ]]; do
|
while [[ $# != 0 ]]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
|
||||||
@ -114,7 +115,10 @@ while [[ $# != 0 ]]; do
|
|||||||
ARG_IMAGE="$2"
|
ARG_IMAGE="$2"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
update|update-image|update-script)
|
||||||
|
special_update_command=$1
|
||||||
|
break
|
||||||
|
;;
|
||||||
-*)
|
-*)
|
||||||
err Unknown option \"$1\"
|
err Unknown option \"$1\"
|
||||||
command:help
|
command:help
|
||||||
@ -142,6 +146,28 @@ FINAL_CONFIG=${ARG_CONFIG-${DOCKCROSS_CONFIG-$DEFAULT_DOCKCROSS_CONFIG}}
|
|||||||
# Set the docker image
|
# Set the docker image
|
||||||
FINAL_IMAGE=${ARG_IMAGE-${DOCKCROSS_IMAGE-$DEFAULT_DOCKCROSS_IMAGE}}
|
FINAL_IMAGE=${ARG_IMAGE-${DOCKCROSS_IMAGE-$DEFAULT_DOCKCROSS_IMAGE}}
|
||||||
|
|
||||||
|
# Handle special update command
|
||||||
|
if [ "$special_update_command" != "" ]; then
|
||||||
|
case $special_update_command in
|
||||||
|
|
||||||
|
update)
|
||||||
|
command:update
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
update-image)
|
||||||
|
command:update-image
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
update-script)
|
||||||
|
command:update-script
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
# Set the docker run extra args (if any)
|
# Set the docker run extra args (if any)
|
||||||
FINAL_ARGS=${ARG_ARGS-${DOCKCROSS_ARGS}}
|
FINAL_ARGS=${ARG_ARGS-${DOCKCROSS_ARGS}}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user