]> Sergey Matveev's repositories - zsh-autoenv.git/commitdiff
tests: test_autoenv_add_to_env: create auth file parent dir (#59)
authorDaniel Hahler <github@thequod.de>
Sun, 23 Apr 2017 12:24:17 +0000 (14:24 +0200)
committerGitHub <noreply@github.com>
Sun, 23 Apr 2017 12:24:17 +0000 (14:24 +0200)
This is required when running single test files, e.g. only cwd.t.

tests/setup.zsh

index 9e789ec3827d2665e4785daf8524bf5cf9f21eec..31aee201214e80dd66c3cf9bd23ffa34f405c6d6 100644 (file)
@@ -30,6 +30,7 @@ fi
 
 # Add file ($1), version ($2), and optional hash ($3) to authentication file.
 test_autoenv_add_to_env() {
+  [[ -d ${AUTOENV_AUTH_FILE:h} ]] || mkdir -p ${AUTOENV_AUTH_FILE:h}
   _autoenv_hash_pair $1 1 ${2:-} >>| $AUTOENV_AUTH_FILE
 }