Skip to content

Commit

Permalink
fixed bug when script has no arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
iDmple committed Dec 17, 2023
1 parent e57f5a4 commit 5547f6c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions docker/unchained.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@ usage() {
echo " To view logs of a node: $0 local logs -f"
}

if [ ! $1 == 'local' ] && [ ! $1 == 'atlas' ] && [ ! $1 == 'lite' ] ; then
if [ ! $1 == 'local' ] && [ ! $1 == 'atlas' ] && [ ! $1 == 'lite' ] || [ -z $2 ]; then
usage
exit 1
fi

UID_GID="$(id -u):$(id -g)"

if [ $2 == 'up' ] ; then
if [ $1 == 'local' ] && [ ! -d 'data' ]; then
mkdir data
fi
if [ $2 == 'up' ] && [ $1 == 'local' ] && [ ! -d 'data' ]; then
mkdir data
fi

UID_GID=$UID_GID COMPOSE_PROFILES=$1 docker compose "${@:2}"

0 comments on commit 5547f6c

Please sign in to comment.