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

POSITIONAL[@]: unbound variable #463

Open
chengyu3075 opened this issue May 19, 2020 · 1 comment
Open

POSITIONAL[@]: unbound variable #463

chengyu3075 opened this issue May 19, 2020 · 1 comment

Comments

@chengyu3075
Copy link

[root@bogon docker]# ./up.sh --dev
~/software/jepsen/jepsen-master/docker ~/software/jepsen/jepsen-master/docker
[INFO] JEPSEN_ROOT is not set, defaulting to: /root/software/jepsen/jepsen-master
[INFO] Running docker-compose with dev config
./up.sh: line 79: POSITIONAL[@]: unbound variable

@yito88
Copy link

yito88 commented May 30, 2020

I modified up.sh script. It works well on macOS 10.15.4 with docker desktop 2.3.0.3.

diff --git a/docker/up.sh b/docker/up.sh
index 0f84f027..3d79dada 100755
--- a/docker/up.sh
+++ b/docker/up.sh
@@ -76,7 +76,7 @@ do
             ;;
     esac
 done
-set -- "${POSITIONAL[@]}" # restore positional parameters
+set -- "${POSITIONAL[@]+"${POSITIONAL[@]}"}" # restore positional parameters

 if [ "${HELP}" -eq 1 ]; then
     echo "Usage: $0 [OPTION]"
@@ -116,7 +116,7 @@ fi
 rm -rf ./control/jepsen
 mkdir -p ./control/jepsen/jepsen
 # Copy the jepsen directory if we're not mounting the JEPSEN_ROOT
-if [ -n "${DEV}" ]; then
+if [ -z "${DEV}" ]; then
     # Dockerfile does not allow `ADD ..`. So we need to copy it here in setup.
     INFO "Copying .. to control/jepsen"
     (

remysaissy added a commit to remysaissy/jepsen that referenced this issue Dec 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants