Skip to content

Commit 114a9fc

Browse files
Fixed log messages to include correct information. (#65)
1 parent 48d4e4f commit 114a9fc

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

scripts/generate-content-converter.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ OTHER_ARGS=$@ # save the remaining args
8080
METASCHEMA="$1"
8181
GENERATED_CONVERTER="$2"
8282

83+
if [ "$VERBOSE" == "true" ] && [ "$PPID" == "$$" ]; then
84+
echo -e "${P_INFO}Using working directory:${P_END} ${WORKING_DIR}"
85+
echo -e "${P_INFO}Using cache directory:${P_END} ${CACHE_DIR}"
86+
fi
87+
8388
if [ -z "$METASCHEMA" ]; then
8489
>&2 echo -e "${P_ERROR}You must specify the Metaschema to generate the converter for.${P_END}"
8590
usage
@@ -91,11 +96,6 @@ if [ ! -f "$METASCHEMA" ]; then
9196
exit 2
9297
fi
9398

94-
if [ "$VERBOSE" == "true" ] && [ "$PPID" == "$$" ]; then
95-
echo -e "${P_INFO}Using working directory:${P_END} ${WORKING_DIR}"
96-
echo -e "${P_INFO}Using cache directory:${P_END} ${CACHE_DIR}"
97-
fi
98-
9999
# make sure working directory exists
100100
mkdir -p "$(dirname "$WORKING_DIR")"
101101

@@ -105,7 +105,7 @@ if ! [[ "$GENERATE_SOURCE_FORMAT" =~ ^(xml|json)$ ]]; then
105105
fi
106106

107107
if ! [[ "$GENERATE_TARGET_FORMAT" =~ ^(xml|json)$ ]]; then
108-
>&2 echo -e "${P_ERROR}Invalid source format '${P_END}${GENERATE_TARGET_FORMAT}${P_ERROR}'.${P_END} Supported formats are: xml or json"
108+
>&2 echo -e "${P_ERROR}Invalid target format '${P_END}${GENERATE_TARGET_FORMAT}${P_ERROR}'.${P_END} Supported formats are: xml or json"
109109
exit 4
110110
fi
111111

scripts/include/init-schematron.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ init_schematron() {
55
source "${my_dir}/init-saxon.sh"
66

77
if [[ -z "$SCHEMATRON_HOME" ]]; then
8-
echo -e "${P_INFO}SCHEMATRON_HOME is not set or is empty.${P_END} ${P_INFO}Please set SCHEMATRON_HOME to indicate the location of the schematron skeleton. The schematron skeleton can be cloned using git clone https://github.com/Schematron/schematron <schematron_home_dir>.${P_END}"
8+
# echo -e "${P_INFO}SCHEMATRON_HOME is not set or is empty.${P_END} ${P_INFO}Please set SCHEMATRON_HOME to indicate the location of the schematron skeleton. The schematron skeleton can be cloned using git clone https://github.com/Schematron/schematron <schematron_home_dir>.${P_END}"
99
SCHEMATRON_HOME="${my_dir}/../../support/schematron"
1010
fi
1111

@@ -26,9 +26,10 @@ build_schematron() {
2626
xsl_transform "$SCHEMATRON_DIR/iso_svrl_for_xslt2.xsl" "-" "$compiled_schematron" "generate-paths=true diagnose=true allow-foreign=true"
2727
cmd_exitcode=$?
2828
if [ $cmd_exitcode -ne 0 ]; then
29-
echo -e "${P_ERROR}Generating compiled Schematron failed for '$schematron'${P_END}"
29+
echo -e "${P_ERROR}Generating compiled Schematron failed for '${P_END}$schematron${P_ERROR}'.${P_END}"
3030
return 1
3131
fi
32+
echo -e "${P_INFO}Generated compiled Schematron '${P_END}$schematron${P_INFO}' as '${P_END}$compiled_schematron${P_INFO}'.${P_END}"
3233
return 0
3334
}
3435

0 commit comments

Comments
 (0)