mirror of
https://github.com/fauxpilot/fauxpilot.git
synced 2025-08-20 21:34:13 -07:00
feat: add option of launch.sh
This PR is to add an option function for the user to selectively use foreground mode and background mode (i.e., daemon mode). Also, depending on the version of docker composer, the -d (daemon mode) option may or may not be present. Therefore, this is to deal effectively with these situations. Signed-off-by: Geunsik Lim <leemgs@gmail.com> Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
This commit is contained in:
parent
00db26c3b7
commit
3ddde13f5f
1 changed files with 26 additions and 1 deletions
27
launch.sh
27
launch.sh
|
@ -7,5 +7,30 @@ if [ ! -f .env ]; then
|
|||
fi
|
||||
source .env
|
||||
|
||||
function help() {
|
||||
# Display Help
|
||||
echo
|
||||
echo "Usage: $0 [option...]"
|
||||
echo "options:"
|
||||
echo "-h, --help Print this Help."
|
||||
echo "-d, --daemon Start with a daemon mode."
|
||||
echo
|
||||
}
|
||||
|
||||
while getopts ":h:d" option; do
|
||||
case $option in
|
||||
h)
|
||||
help
|
||||
exit;;
|
||||
d)
|
||||
options="-d"
|
||||
echo "-d option"
|
||||
;;
|
||||
\?) # incorrect option
|
||||
echo "Error: Invalid option"
|
||||
exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
# On newer versions, docker-compose is docker compose
|
||||
docker compose up -d --remove-orphans || docker-compose up -d --remove-orphans
|
||||
docker compose up $options --remove-orphans || docker-compose up $options --remove-orphans
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue