From c1c06aaa4e494851485d41482d367c4bf48c22d1 Mon Sep 17 00:00:00 2001 From: SebastianObi Date: Sun, 23 Oct 2022 19:26:06 +0200 Subject: [PATCH] Fixed members count issue --- build_git.sh | 31 +++++++++++++++++-- .../lxmf_distribution_group.py | 2 +- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/build_git.sh b/build_git.sh index 0410369..8602b02 100755 --- a/build_git.sh +++ b/build_git.sh @@ -21,7 +21,7 @@ COMMENT_INIT="Initial commit" _prompt() { echo -e "" echo -e "Select an option:" - options=("Commit/Push" "Clear History" "Init" "Exit") + options=("Commit/Push" "Clear History" "Init" "Init (Pull only)" "Exit") select opt in "${options[@]}"; do case $opt in "Commit/Push"*) @@ -30,6 +30,9 @@ _prompt() { "Clear History"*) _clear break;; + "Init (Pull only)"*) + _init_pull + break;; "Init"*) _init break;; @@ -120,7 +123,31 @@ _init() { git pull origin "${BRANCH}" git commit -m "${VAR}" - + + git push -f -u origin "${BRANCH}" +} + + +_init_pull() { + echo -e "" + echo -e "Init (Pull only)" + + read VAR + if [ -z "${VAR}" ]; then + VAR="${COMMENT_INIT}" + fi + + rm -rf .git + + git init + + _define_files + + git branch -M "${BRANCH}" + git remote add origin "${ORIGIN}" + + git pull origin "${BRANCH}" + git push -f -u origin "${BRANCH}" } diff --git a/lxmf_distribution_group/lxmf_distribution_group.py b/lxmf_distribution_group/lxmf_distribution_group.py index 4443e4a..d3d542b 100755 --- a/lxmf_distribution_group/lxmf_distribution_group.py +++ b/lxmf_distribution_group/lxmf_distribution_group.py @@ -2607,7 +2607,7 @@ def replace(text, source_hash, source_name, source_right, lng_key): if delimiter+"count_members"+delimiter in text: count = 0 - for (section) in CONFIG.items("rights"): + for (section, section_val) in CONFIG.items("rights"): if DATA.has_section(section): for (key, val) in DATA.items(section): count += 1