fix bug in subst.entry-index.sh, improve awk scripts
Fixed a bug that was introduced into `bin/subst.entry-index.sh` where the value `$HTML_SED` was set too early. Shell functions variables are evaluated when they are executed, not when they are first parsed. So exported variables used by a shell function need to be set only before the shell function is executed. Checkpoint `bin/cvt-submission.sh` as part of our testing. Set file modes of 0444 for when `.auth.json` is formed from `.auth.json.xz`. The awk scripts under bin put their name (basename) into error messages to make it easier to debug any error they might raise. Changed `bin/cvt-submission.sh` VERSION from "2.0.1 2025-05-01" to "2.0.2 2025-05-17". Changed `bin/filelist.entry.json.awk` VERSION from "1.0 2024-02-12" to "1.0.1 2025-05-17". Changed `bin/manifest.csv.entry.awk` VERSION from "1.0 2024-07-14" to "1.0.1 2025-05-17". Changed `bin/manifest.entry.json.awk` VERSION from "1.2.1 2024-11-16" to "1.2.2 2025-05-17". Changed `bin/subst.entry-index.sh` VERSION from "2.0.0 2025-03-13" to "2.0.1 2025-05-17". Changed `bin/subst.entry-navbar.awk` VERSION from "1.3 2024-08-02" to "1.3.1 2025-05-17". Changed `bin/subst.year-navbar.awk` VERSION from "1.2 2024-04-04" to "1.2.1 2025-05-17". Update sitemap. Tested the above via `make update` on macOS.
This commit is contained in:
1 parent
665a46ef4a
commit
0aa790fd88
9 files changed
+136
-114
No files matched your search
+77
-51
@@ -124,7 +124,7 @@ export LC_ALL="C"
|
||||
|
||||
# set variables referenced in the usage message
|
||||
#
|
||||
export VERSION="2.0.1 2025-05-01"
|
||||
export VERSION="2.0.2 2025-05-17"
|
||||
NAME=$(basename "$0")
|
||||
export NAME
|
||||
export V_FLAG=0
|
||||
@@ -891,6 +891,16 @@ if [[ ! -d $TOPDIR ]]; then
|
||||
exit 6
|
||||
fi
|
||||
|
||||
|
||||
# verify that we have a bin subdirectory
|
||||
#
|
||||
export BIN_PATH="$TOPDIR/bin"
|
||||
if [[ ! -d $BIN_PATH ]]; then
|
||||
echo "$0: ERROR: bin is not a directory under topdir: $BIN_PATH" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
export BIN_DIR="bin"
|
||||
|
||||
# cd to topdir
|
||||
#
|
||||
if [[ ! -e $TOPDIR ]]; then
|
||||
@@ -936,16 +946,6 @@ if [[ ! -s $TOP_FILE ]]; then
|
||||
fi
|
||||
|
||||
|
||||
# verify that we have a bin subdirectory
|
||||
#
|
||||
export BIN_PATH="$TOPDIR/bin"
|
||||
if [[ ! -d $BIN_PATH ]]; then
|
||||
echo "$0: ERROR: bin is not a directory under topdir: $BIN_PATH" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
export BIN_DIR="bin"
|
||||
|
||||
|
||||
# verify that the bin/md2html.sh tool is executable
|
||||
#
|
||||
export MD2HTML_SH="$BIN_DIR/md2html.sh"
|
||||
@@ -1047,6 +1047,7 @@ fi
|
||||
#
|
||||
export INFO_JSON="$YYYY_DIR/.info.json"
|
||||
export AUTH_JSON="$YYYY_DIR/.auth.json"
|
||||
export AUTH_JSON_XZ="$YYYY_DIR/.auth.json.xz"
|
||||
export REMARKS_MD="$YYYY_DIR/remarks.md"
|
||||
export TAR_BZ2="$YYYY_DIR/$ENTRY_ID.tar.bz2"
|
||||
export ENTRY_JSON="$YYYY_DIR/.entry.json"
|
||||
@@ -1131,6 +1132,7 @@ if [[ $V_FLAG -ge 3 ]]; then
|
||||
echo "$0: debug[3]: YYYY_DIR=$YYYY_DIR" 1>&2
|
||||
echo "$0: debug[3]: INFO_JSON=$INFO_JSON" 1>&2
|
||||
echo "$0: debug[3]: AUTH_JSON=$AUTH_JSON" 1>&2
|
||||
echo "$0: debug[3]: AUTH_JSON_XZ=$AUTH_JSON_XZ" 1>&2
|
||||
echo "$0: debug[3]: REMARKS_MD=$REMARKS_MD" 1>&2
|
||||
echo "$0: debug[3]: TAR_BZ2=$TAR_BZ2" 1>&2
|
||||
echo "$0: debug[3]: ENTRY_JSON=$ENTRY_JSON" 1>&2
|
||||
@@ -1212,6 +1214,50 @@ if ! grep -E -q "^$YEAR_DIR$" "$TOP_FILE"; then
|
||||
fi
|
||||
|
||||
|
||||
# case: we have .auth.json.xz but not .auth.json
|
||||
#
|
||||
# Form a .auth.json from .auth.json.xz
|
||||
#
|
||||
if [[ -f $AUTH_JSON_XZ && ! -f $AUTH_JSON ]]; then
|
||||
if [[ -z $NOOP ]]; then
|
||||
|
||||
if [[ $V_FLAG -ge 3 ]]; then
|
||||
echo "$0: debug[3]: about to execute:" \
|
||||
"xzcat $AUTH_JSON_XZ > $AUTH_JSON" 1>&2
|
||||
fi
|
||||
xzcat "$AUTH_JSON_XZ" > "$AUTH_JSON"
|
||||
status="$?"
|
||||
if [[ $status -ne 0 ]]; then
|
||||
echo "$0: ERROR:" \
|
||||
"xzcat $AUTH_JSON_XZ > $AUTH_JSON failed, error: $status" 1>&2
|
||||
exit 7
|
||||
fi
|
||||
if [[ $V_FLAG -ge 3 ]]; then
|
||||
echo "$0: debug[3]: about to execute:" \
|
||||
"chmod -v 0444 $AUTH_JSON" 1>&2
|
||||
chmod -v 0444 "$AUTH_JSON"
|
||||
status="$?"
|
||||
if [[ $status -ne 0 ]]; then
|
||||
echo "$0: ERROR:" \
|
||||
"chmod -v 0444 $AUTH_JSON failed, error: $status" 1>&2
|
||||
exit 7
|
||||
fi
|
||||
else
|
||||
chmod 0444 "$AUTH_JSON"
|
||||
status="$?"
|
||||
if [[ $status -ne 0 ]]; then
|
||||
echo "$0: ERROR:" \
|
||||
"chmod 0444 $AUTH_JSON failed, error: $status" 1>&2
|
||||
exit 7
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [[ $V_FLAG -ge 3 ]]; then
|
||||
echo "$0: debug[3]: because of -n, $AUTH_JSON file was not formed" 1>&2
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# verify .info.json and .auth.json are readable non-empty files
|
||||
#
|
||||
if [[ ! -e $INFO_JSON ]]; then
|
||||
@@ -1230,21 +1276,25 @@ if [[ ! -s $INFO_JSON ]]; then
|
||||
echo "$0: ERROR: .info.json is not a non-empty readable file: $INFO_JSON" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -e $AUTH_JSON ]]; then
|
||||
echo "$0: ERROR: .auth.json does not exist: $AUTH_JSON" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -f $AUTH_JSON ]]; then
|
||||
echo "$0: ERROR: .auth.json is not a regular file: $AUTH_JSON" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -r $AUTH_JSON ]]; then
|
||||
echo "$0: ERROR: .auth.json is not a readable file: $AUTH_JSON" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -s $AUTH_JSON ]]; then
|
||||
echo "$0: ERROR: .auth.json is not a non-empty readable file: $AUTH_JSON" 1>&2
|
||||
exit 6
|
||||
if [[ -z $NOOP ]]; then
|
||||
if [[ ! -e $AUTH_JSON ]]; then
|
||||
echo "$0: ERROR: .auth.json does not exist: $AUTH_JSON" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -f $AUTH_JSON ]]; then
|
||||
echo "$0: ERROR: .auth.json is not a regular file: $AUTH_JSON" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -r $AUTH_JSON ]]; then
|
||||
echo "$0: ERROR: .auth.json is not a readable file: $AUTH_JSON" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -s $AUTH_JSON ]]; then
|
||||
echo "$0: ERROR: .auth.json is not a non-empty readable file: $AUTH_JSON" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
elif [[ $V_FLAG -ge 3 ]]; then
|
||||
echo "$0: debug[3]: because of -n, $AUTH_JSON file not checked" 1>&2
|
||||
fi
|
||||
|
||||
|
||||
@@ -1293,7 +1343,7 @@ done
|
||||
#
|
||||
if [[ $V_FLAG -ge 3 ]]; then
|
||||
for index in "${!TAR_FILE_SET[@]}"; do
|
||||
echo "$0: debug[3]: TAR_FILE_SET[$index]=${TAR_FILE_SET[$index]}" 1>&2
|
||||
echo "$0: debug[3]: TAR_FILE_SET[$index]=${TAR_FILE_SET[$index]}" 1>&2
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -1343,29 +1393,6 @@ elif [[ $V_FLAG -ge 3 ]]; then
|
||||
fi
|
||||
|
||||
|
||||
# case: we have .auth.json.xz but not .auth.json
|
||||
#
|
||||
# Form a .auth.json from .auth.json.xz
|
||||
#
|
||||
if [[ -f $AUTH_JSON.xz && ! -f $AUTH_JSON ]]; then
|
||||
if [[ -z $NOOP ]]; then
|
||||
if [[ $V_FLAG -ge 3 ]]; then
|
||||
echo "$0: debug[3]: about to execute:" \
|
||||
"xzcat $AUTH_JSON.xz > $AUTH_JSON" 1>&2
|
||||
fi
|
||||
xzcat "$AUTH_JSON.xz" > "$AUTH_JSON"
|
||||
status="$?"
|
||||
if [[ $status -ne 0 ]]; then
|
||||
echo "$0: ERROR:" \
|
||||
"xzcat $AUTH_JSON.xz > $AUTH_JSON failed, error: $status" 1>&2
|
||||
exit 7
|
||||
fi
|
||||
elif [[ $V_FLAG -ge 3 ]]; then
|
||||
echo "$0: debug[3]: because of -n, $AUTH_JSON file was not formed" 1>&2
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# perform the semantic check on .info.json and .auth.json
|
||||
#
|
||||
if [[ $V_FLAG -ge 1 ]]; then
|
||||
@@ -2384,7 +2411,6 @@ elif [[ $V_FLAG -ge 3 ]]; then
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# build HTML files based on extra_file markdown files
|
||||
#
|
||||
for EXTRA_FILE in $EXTRA_FILE_SET; do
|
||||
|
||||
@@ -21,7 +21,8 @@ BEGIN {
|
||||
|
||||
# setup
|
||||
#
|
||||
VERSION="1.0 2024-02-12"
|
||||
VERSION="1.0.1 2025-05-17"
|
||||
NAME = "filelist.entry.json.awk"
|
||||
found_manifest_array = 0; # 1 ==> we found the manifest ARRAY
|
||||
within_manifest_array = 0; # 1 ==> found start of "manifest" : [ JSON array
|
||||
begin_manifest_element = 0; # 1 ==> we have found the start of the manifest array element
|
||||
@@ -128,7 +129,7 @@ within_manifest_array == 1 && begin_manifest_element == 1 && NF == 1 && $1 ~ /^}
|
||||
# verify we have seen a file_path JSON member
|
||||
#
|
||||
if (length(file_path) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a file_path JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a file_path JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 212;
|
||||
}
|
||||
|
||||
@@ -152,40 +153,40 @@ END {
|
||||
# case: we quit because we could not determine dir from ARGV[1]
|
||||
#
|
||||
if (length(dir) == 0) {
|
||||
print "ERROR: cannot determine dir from:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": cannot determine dir from:", ARGV[1] > "/dev/stderr";
|
||||
exit 210; # END section will output ERROR message about cannot find dir
|
||||
}
|
||||
|
||||
if (length(YYYY) == 0) {
|
||||
print "ERROR: cannot determine YYYY from:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": cannot determine YYYY from:", ARGV[1] > "/dev/stderr";
|
||||
exit 211; # END section will output ERROR message about cannot find YYYY
|
||||
}
|
||||
|
||||
# verify we have seen a file_path JSON member
|
||||
#
|
||||
if (length(file_path) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a file_path JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a file_path JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 212;
|
||||
}
|
||||
|
||||
# case: no manifest array was found
|
||||
#
|
||||
if (!found_manifest_array) {
|
||||
print "ERROR: we did not find a manifest JSON array in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": we did not find a manifest JSON array in:", ARGV[1] > "/dev/stderr";
|
||||
exit 213;
|
||||
}
|
||||
|
||||
# case: manifest array was found, but manifest array element did not finish
|
||||
#
|
||||
if (begin_manifest_element) {
|
||||
print "ERROR: manifest JSON array element did not end in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest JSON array element did not end in:", ARGV[1] > "/dev/stderr";
|
||||
exit 214;
|
||||
}
|
||||
|
||||
# case: manifest array did not end
|
||||
#
|
||||
if (within_manifest_array) {
|
||||
print "ERROR: manifest JSON array did not end in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest JSON array did not end in:", ARGV[1] > "/dev/stderr";
|
||||
exit 215;
|
||||
}
|
||||
}
|
||||
+14
-13
@@ -25,7 +25,8 @@ BEGIN {
|
||||
|
||||
# setup
|
||||
#
|
||||
VERSION="1.0 2024-07-14"
|
||||
VERSION="1.0.1 2025-05-17"
|
||||
NAME = "manifest.csv.entry.awk"
|
||||
found_manifest_array = 0; # 1 ==> we found the manifest ARRAY
|
||||
within_manifest_array = 0; # 1 ==> found start of "manifest" : [ JSON array
|
||||
begin_manifest_element = 0; # 1 ==> we have found the start of the manifest array element
|
||||
@@ -318,42 +319,42 @@ within_manifest_array == 1 && begin_manifest_element == 1 && NF == 1 && $1 ~ /^}
|
||||
# verify we have seen a file_path JSON member
|
||||
#
|
||||
if (length(file_path) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a file_path JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a file_path JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 213;
|
||||
}
|
||||
|
||||
# verify we have seen a inventory_order JSON member
|
||||
#
|
||||
if (length(inventory_order) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a inventory_order JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a inventory_order JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 214;
|
||||
}
|
||||
|
||||
# verify we have seen a OK_to_edit JSON member
|
||||
#
|
||||
if (length(OK_to_edit) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a OK_to_edit JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a OK_to_edit JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 215;
|
||||
}
|
||||
|
||||
# verify we have seen a display_as JSON member
|
||||
#
|
||||
if (length(display_as) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a display_as JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a display_as JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 216;
|
||||
}
|
||||
|
||||
# verify we have seen a display_via_github JSON member
|
||||
#
|
||||
if (length(display_via_github) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a display_via_github JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a display_via_github JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 217;
|
||||
}
|
||||
|
||||
# verify we have seen a entry_text JSON member
|
||||
#
|
||||
if (length(entry_text) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a entry_text JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a entry_text JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 218;
|
||||
}
|
||||
|
||||
@@ -377,39 +378,39 @@ END {
|
||||
# case: invalid YYYY
|
||||
#
|
||||
if (length(YYYY) == 0) {
|
||||
print "ERROR: cannot determine YYYY from:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": cannot determine YYYY from:", ARGV[1] > "/dev/stderr";
|
||||
exit 220; # END section will output ERROR message about cannot find YYYY
|
||||
}
|
||||
if (YYYY !~ /^[[:digit:]]+$/ || YYYY < 1984 || YYYY > 9999) {
|
||||
print "ERROR: YYYY: must be 4 digit integer >= 1984 and <= 9999, found: " YYYY;
|
||||
print "ERROR:", NAME ": YYYY: must be 4 digit integer >= 1984 and <= 9999, found: " YYYY;
|
||||
exit 221; # invalid year
|
||||
}
|
||||
|
||||
# case: we quit because we could not determine dir from ARGV[1]
|
||||
#
|
||||
if (length(dir) == 0) {
|
||||
print "ERROR: cannot determine dir from:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": cannot determine dir from:", ARGV[1] > "/dev/stderr";
|
||||
exit 222; # END section will output ERROR message about cannot find dir
|
||||
}
|
||||
|
||||
# case: no manifest array was found
|
||||
#
|
||||
if (!found_manifest_array) {
|
||||
print "ERROR: we did not find a manifest JSON array in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": we did not find a manifest JSON array in:", ARGV[1] > "/dev/stderr";
|
||||
exit 223;
|
||||
}
|
||||
|
||||
# case: manifest array was found, but manifest array element did not finish
|
||||
#
|
||||
if (begin_manifest_element) {
|
||||
print "ERROR: manifest JSON array element did not end in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest JSON array element did not end in:", ARGV[1] > "/dev/stderr";
|
||||
exit 224;
|
||||
}
|
||||
|
||||
# case: manifest array did not end
|
||||
#
|
||||
if (within_manifest_array) {
|
||||
print "ERROR: manifest JSON array did not end in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest JSON array did not end in:", ARGV[1] > "/dev/stderr";
|
||||
exit 225;
|
||||
}
|
||||
}
|
||||
+15
-14
@@ -23,7 +23,8 @@ BEGIN {
|
||||
|
||||
# setup
|
||||
#
|
||||
VERSION="1.2.1 2024-11-16"
|
||||
VERSION="1.2.2 2025-05-17"
|
||||
NAME = "manifest.entry.json.awk"
|
||||
found_manifest_array = 0; # 1 ==> we found the manifest ARRAY
|
||||
within_manifest_array = 0; # 1 ==> found start of "manifest" : [ JSON array
|
||||
begin_manifest_element = 0; # 1 ==> we have found the start of the manifest array element
|
||||
@@ -334,7 +335,7 @@ within_manifest_array == 1 && begin_manifest_element == 1 && NF >= 3 && $1 ~ /^"
|
||||
# validate exit code from jstrdecode
|
||||
#
|
||||
if (length(exit_code) == 0 || exit_code != 0) {
|
||||
print "ERROR: unable to jstrdecode entry_text:", entry_text > "/dev/stderr";
|
||||
print "ERROR:", NAME ": unable to jstrdecode entry_text:", entry_text > "/dev/stderr";
|
||||
exit 213; # END section will output ERROR message about cannot JSON decode entry_text
|
||||
}
|
||||
|
||||
@@ -354,42 +355,42 @@ within_manifest_array == 1 && begin_manifest_element == 1 && NF == 1 && $1 ~ /^}
|
||||
# verify we have seen a file_path JSON member
|
||||
#
|
||||
if (length(file_path) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a file_path JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a file_path JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 214;
|
||||
}
|
||||
|
||||
# verify we have seen a inventory_order JSON member
|
||||
#
|
||||
if (length(inventory_order) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a inventory_order JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a inventory_order JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 215;
|
||||
}
|
||||
|
||||
# verify we have seen a OK_to_edit JSON member
|
||||
#
|
||||
if (length(OK_to_edit) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a OK_to_edit JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a OK_to_edit JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 216;
|
||||
}
|
||||
|
||||
# verify we have seen a display_as JSON member
|
||||
#
|
||||
if (length(display_as) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a display_as JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a display_as JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 217;
|
||||
}
|
||||
|
||||
# verify we have seen a display_via_github JSON member
|
||||
#
|
||||
if (length(display_via_github) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a display_via_github JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a display_via_github JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 218;
|
||||
}
|
||||
|
||||
# verify we have seen a entry_text JSON member
|
||||
#
|
||||
if (length(entry_text) == 0) {
|
||||
print "ERROR: manifest array JSON member did not have a entry_text JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest array JSON member did not have a entry_text JSON member in:", ARGV[1] > "/dev/stderr";
|
||||
exit 219;
|
||||
}
|
||||
|
||||
@@ -432,40 +433,40 @@ END {
|
||||
# case: we quit due to github unset
|
||||
#
|
||||
if (length(github) == 0) {
|
||||
print "ERROR: github variable not set, call with -v github=REPO_URL" > "/dev/stderr";
|
||||
print "ERROR:", NAME ": github variable not set, call with -v github=REPO_URL" > "/dev/stderr";
|
||||
exit 220; # use 200 to match exit code from BEGIN
|
||||
}
|
||||
|
||||
# case: we quit because we could not determine dir from ARGV[1]
|
||||
#
|
||||
if (length(dir) == 0) {
|
||||
print "ERROR: cannot determine dir from:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": cannot determine dir from:", ARGV[1] > "/dev/stderr";
|
||||
exit 221; # END section will output ERROR message about cannot find dir
|
||||
}
|
||||
|
||||
if (length(YYYY) == 0) {
|
||||
print "ERROR: cannot determine YYYY from:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": cannot determine YYYY from:", ARGV[1] > "/dev/stderr";
|
||||
exit 222; # END section will output ERROR message about cannot find YYYY
|
||||
}
|
||||
|
||||
# case: no manifest array was found
|
||||
#
|
||||
if (!found_manifest_array) {
|
||||
print "ERROR: we did not find a manifest JSON array in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": we did not find a manifest JSON array in:", ARGV[1] > "/dev/stderr";
|
||||
exit 223;
|
||||
}
|
||||
|
||||
# case: manifest array was found, but manifest array element did not finish
|
||||
#
|
||||
if (begin_manifest_element) {
|
||||
print "ERROR: manifest JSON array element did not end in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest JSON array element did not end in:", ARGV[1] > "/dev/stderr";
|
||||
exit 224;
|
||||
}
|
||||
|
||||
# case: manifest array did not end
|
||||
#
|
||||
if (within_manifest_array) {
|
||||
print "ERROR: manifest JSON array did not end in:", ARGV[1] > "/dev/stderr";
|
||||
print "ERROR:", NAME ": manifest JSON array did not end in:", ARGV[1] > "/dev/stderr";
|
||||
exit 225;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# md2html.sh - convert markdown into an IOCCC HTML file via config file
|
||||
#
|
||||
|
||||
@@ -136,7 +136,7 @@ export LC_ALL="C"
|
||||
|
||||
# set variables referenced in the usage message
|
||||
#
|
||||
export VERSION="2.0.0 2025-03-13"
|
||||
export VERSION="2.0.1 2025-05-17"
|
||||
NAME=$(basename "$0")
|
||||
export NAME
|
||||
export V_FLAG=0
|
||||
@@ -230,10 +230,6 @@ Exit codes:
|
||||
|
||||
$NAME version: $VERSION"
|
||||
|
||||
# We need this here as the functions refer to it. We will check that it exists
|
||||
# before using it, however.
|
||||
export HTML_SED="$BIN_DIR/html.sed"
|
||||
|
||||
# Write the award name to standard output (stdout)
|
||||
#
|
||||
# usage:
|
||||
@@ -525,8 +521,10 @@ if [[ ! -r $ENTRY_NAVBAR_AWK ]]; then
|
||||
exit 5
|
||||
fi
|
||||
|
||||
|
||||
# verify we have our sed script
|
||||
#
|
||||
export HTML_SED="$BIN_DIR/html.sed"
|
||||
if [[ ! -e $HTML_SED ]]; then
|
||||
echo "$0: ERROR: bin/html.sed does not exist: $HTML_SED" 1>&2
|
||||
exit 5
|
||||
@@ -541,8 +539,6 @@ if [[ ! -r $HTML_SED ]]; then
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
# verify that ENTRY_PATH is a entry directory
|
||||
#
|
||||
if [[ ! -d $ENTRY_PATH ]]; then
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
#
|
||||
# awk -v entry_path=YYYY/dir -f bin/subst.entry-navbar.awk YYYY/.year
|
||||
#
|
||||
# usage:
|
||||
#
|
||||
# awk -v entry_path=YYYY/dir -f bin/subst.entry-navbar.awk .allyear
|
||||
#
|
||||
# where:
|
||||
#
|
||||
# YYYY IOCCC year or mock
|
||||
@@ -26,7 +22,8 @@ BEGIN {
|
||||
|
||||
# setup
|
||||
#
|
||||
VERSION="1.3 2024-08-02"
|
||||
VERSION="1.3.1 2025-05-17"
|
||||
NAME = "subst.entry-navbar.awk"
|
||||
process_next_line = 0; # 1 ==> we found our entry_path, now process the next line
|
||||
found_entry_path = 0; # 1 ==> we found our entry_path
|
||||
prev_line = ""; # the previous YYYY/dir line
|
||||
@@ -159,7 +156,7 @@ END {
|
||||
#
|
||||
if (length(entry_path) == 0) {
|
||||
print "-e";
|
||||
print "ERROR: github variable not set, call with -v github=REPO_URL";
|
||||
print "ERROR:", NAME ": github variable not set, call with -v github=REPO_URL";
|
||||
print "-E";
|
||||
print "210"; # use 210 to match length(entry_path) == 0 error in the BEGIN section
|
||||
exit 210; # use 210 to match length(entry_path) == 0 error in the BEGIN section
|
||||
@@ -182,7 +179,7 @@ END {
|
||||
if (!found_entry_path) {
|
||||
# ERROR: entry_path was not found
|
||||
print "-e";
|
||||
print "'we did not find:", entry_path "'";
|
||||
print "'" NAME ": did not find:", entry_path "'";
|
||||
print "-E";
|
||||
print "215";
|
||||
exit
|
||||
|
||||
@@ -21,7 +21,8 @@ BEGIN {
|
||||
|
||||
# setup
|
||||
#
|
||||
VERSION="1.2 2024-04-04"
|
||||
VERSION="1.2.1 2025-05-17"
|
||||
NAME = "subst.year-navbar.awk"
|
||||
process_next_line = 0; # 1 ==> we found our year_arg, now process the next line
|
||||
found_year_arg = 0; # 1 ==> we found our year_arg
|
||||
prev_line = ""; # the previous YYYY line
|
||||
@@ -102,7 +103,7 @@ END {
|
||||
#
|
||||
if (length(year_arg) == 0) {
|
||||
print "-e";
|
||||
print "ERROR: year_arg variable not set, call with -v year_arg=YYYY";
|
||||
print "ERROR:", NAME ": year_arg variable not set, call with -v year_arg=YYYY";
|
||||
print "-E";
|
||||
print "210"; # use 210 to match length(year_arg) == 0 error in the BEGIN section
|
||||
exit 210; # use 210 to match length(year_arg) == 0 error in the BEGIN section
|
||||
@@ -113,7 +114,7 @@ END {
|
||||
if (!found_year_arg) {
|
||||
# ERROR: year_arg was not found
|
||||
print "-e";
|
||||
print "'we did not find:", year_arg "'";
|
||||
print "'" NAME ": did not find:", year_arg "'";
|
||||
print "-E";
|
||||
print "215";
|
||||
exit
|
||||
|
||||
Reference in new issue
Block a user