]> git.armaanb.net Git - stagit.git/commitdiff
fix issues in example scripts
authorHiltjo Posthuma <hiltjo@codemadness.org>
Fri, 1 Mar 2019 10:49:29 +0000 (11:49 +0100)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Fri, 1 Mar 2019 10:49:29 +0000 (11:49 +0100)
- in case cd fails don't continue (don't write in previous directory).
- post-receive: quote $(pwd) in case it has spaces.

found by shellcheck tool.

example_create.sh
example_post-receive.sh

index aff7d54da75611ae7d20ec6a4887bdcd7778e15b..cf16e1d6f73dca4e8bb35997289600f88ad10a64 100755 (executable)
@@ -30,7 +30,7 @@ for dir in "${reposdir}/"*/; do
        printf "%s... " "${d}"
 
        mkdir -p "${curdir}/${d}"
-       cd "${curdir}/${d}"
+       cd "${curdir}/${d}" || continue
        stagit -c ".cache" "${reposdir}/${r}"
 
        # symlinks
index 065556903ec6734b0f75715309c95acccfb71310..c9bcb5e61d048a455652c5d197486bfd82b2e1a2 100755 (executable)
@@ -14,7 +14,7 @@ export LC_CTYPE="en_US.UTF-8"
 
 name="$1"
 if test "${name}" = ""; then
-       name=$(basename $(pwd))
+       name=$(basename "$(pwd)")
 fi
 
 # config