]> git.armaanb.net Git - stagit.git/commitdiff
improve example: strip .git suffix
authorHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 29 May 2016 11:06:32 +0000 (13:06 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 29 May 2016 11:06:32 +0000 (13:06 +0200)
stagit-index and stagit strip the .git suffix so also strip it from the
directory for the possible www root.

Thanks to ng0 for reporting it!

example.sh

index 6f4ea2dd294bd7be48180c3f765099d0bab1d0cb..e85b50c9d1fac248df28d4b0f91dea4362b75770 100644 (file)
@@ -22,12 +22,13 @@ find . -maxdepth 1 -type d | grep -v "^.$" | sort | xargs stagit-index > "${curd
 # make files per repo.
 cd "${reposdir}"
 find . -maxdepth 1 -type d | grep -v "^.$" | sort | while read -r dir; do
-       d=$(basename "${dir}")
+       r=$(basename "${dir}")
+       d=$(basename "${dir}" ".git")
        printf "%s... " "${d}"
 
        mkdir -p "${curdir}/${d}"
        cd "${curdir}/${d}"
-       stagit -c ".cache" "${reposdir}/${d}"
+       stagit -c ".cache" "${reposdir}/${r}"
 
        # symlinks
        ln -sf log.html index.html