cli icon indicating copy to clipboard operation
cli copied to clipboard

Does not work on vaults with spaces in the file path

Open sharjeelsayed opened this issue 6 years ago • 1 comments
trafficstars

Does not work on vault paths with spaces in the file path if you pass it as a bash variable.I tried escaping with \ and quotes( double and single too) but doesn't work. This is on MacOS Mojave with the latest bash 5.0.2(1)

java -version openjdk version "12" 2019-03-19 OpenJDK Runtime Environment (build 12+33) OpenJDK 64-Bit Server VM (build 12+33, mixed mode, sharing)

e.g. CRYPTOMATOR_PATH="cryptomator-cli-0.3.1.jar" MOUNT_PATH="$HOME/VAULT_$RANDOM" VAULT_PATH="/Users/abc/some drive/abcvault" #VAULT_PATH="/Users/abc/some\ drive/abcvault" #VAULT_PATH='/Users/abc/some drive/abcvault' VAULT_PASSWORD="secret;" VAULT_NAME="abcvault" BIND_HOST="localhost" BIND_PORT="8198"

/usr/bin/java -jar $CRYPTOMATOR_PATH --vault $VAULT_NAME=$VAULT_PATH --password $VAULT_NAME=$VAULT_PASSWORD --bind $BIND_HOST --port $BIND_PORT

[main] ERROR org.cryptomator.cli.CryptomatorCli - Not a directory: /Users/abc/some

sharjeelsayed avatar Mar 24 '19 23:03 sharjeelsayed

Seems to be a bug in Apache Commons CLI. It seems to work on some systems (depending on which shell you use...?)

But even it it worked, you'd need to quote the string. Since your quotes are already "used" during the variable assignment, they no longer exist when executing java. So you'd probably need to double quote the string:

VAULT_PATH="/Users/abc/some drive/abcvault"
# VAULT_PATH is now: /Users/abc/some drive/abcvault

VAULT_PATH="\"/Users/abc/some drive/abcvault\""
# VAULT_PATH is now: "/Users/abc/some drive/abcvault"

overheadhunter avatar Mar 25 '19 07:03 overheadhunter