Skip to content
Snippets Groups Projects
Commit 8aead83a authored by Eliott Sammier's avatar Eliott Sammier
Browse files

Fix CLI count-all for macao_3

parent 6316e15f
No related branches found
No related tags found
1 merge request!1Main
......@@ -17,7 +17,7 @@ if [[ "$1" == "status" ]]; then
exit
fi
export VERSION="${VERSION:-macao_12}" # macao_12 by default
export VERSION="macao_${VERSION:-12}" # macao_12 by default
export MACAO_ROOT="${MACAO_ROOT:-$(dirname "$(realpath "$0")")}"
export SOURCES_DIR="$MACAO_ROOT/Basilisk/MACAO/$VERSION"
export SCRIPTS_DIR="$MACAO_ROOT/tetras_extraction/$VERSION/script"
......@@ -27,7 +27,7 @@ mkdir -p "$INDEXES_DIR"
print_usage() {
cat <<EOF
Usage: $(basename "$0") <command> [args]
Usage: $(basename "$0") [version] <command> [args]
COMMANDS
......@@ -131,8 +131,13 @@ count_all() {
exit 1
fi
if [[ "$VERSION" = "macao_3" ]]; then
nb_mod="$(grep -c '<item identifier="seq' "$SOURCES_DIR/imsmanifest.xml")"
nb_subs="$(grep -Ec 'act[0-9]+.html' "$index")"
else
nb_mod="$(grep -c '<item identifier="MosMod' "$SOURCES_DIR/imsmanifest.xml")"
nb_subs="$(grep -Ec 'MosEtp[0-9]+.html' "$index")"
fi
nb_pages_all="$(grep -Ec '/contenu/.*\.htm' "$index")"
nb_pages="$(grep -Ec '/contenu/pages/pg[0-9]+\.html$' "$index")"
nb_pages_special="$((nb_pages_all - nb_pages))"
......
modules: 0
sous-parties: 0
modules: 5
sous-parties: 14
pages: 97
normales: 86
spéciales: 11
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment