]> Sergey Matveev's repositories - public-inbox.git/commitdiff
examples/grok-pull.post_update_hook: fix config detection
authorEric Wong <e@80x24.org>
Fri, 18 Oct 2019 07:54:25 +0000 (07:54 +0000)
committerEric Wong <e@80x24.org>
Fri, 18 Oct 2019 07:55:14 +0000 (07:55 +0000)
We need to account for both the old ("mainrepo") and new
("inboxdir") names.  But "dir" was just a search+replace
error and we don't use that outside of "coderepo.dir".

examples/grok-pull.post_update_hook.sh

index ab4e54e7bf0630c95728cfbe769e6fd08ad4f8c0..d003448eb81b0f5328f31c178751584839dfe74d 100755 (executable)
@@ -26,7 +26,13 @@ else
 fi
 
 # run public-inbox-init iff unconfigured
-cfg_dir=$(git config -f "$PI_CONFIG" publicinbox."$inbox_name".dir)
+cfg_dir=$(git config -f "$PI_CONFIG" publicinbox."$inbox_name".inboxdir)
+
+# check legacy name for "inboxdir"
+case $cfg_dir in
+'') cfg_dir=$(git config -f "$PI_CONFIG" publicinbox."$inbox_name".mainrepo) ;;
+esac
+
 case $cfg_dir in
 '')
        remote_git_url=$(git --git-dir="$full_git_dir" config remote.origin.url)