Skip to content

Commit

Permalink
Edit inline comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Scavo committed Oct 30, 2016
1 parent 09a3c3e commit 6198803
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bin/http_xsltproc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ display_help () {
/bin/cat <<- HELP_MSG
This script is a wrapper around the xsltproc command-line tool.
Like xsltproc, this script applies an XSL stylesheet to an XML
document and outputs the resulting transformation on stdout.
document and outputs the resulting transformed document on stdout.
Unlike xsltproc, this script fetches the target XML document
from an HTTP server.
Expand Down Expand Up @@ -57,11 +57,13 @@ display_help () {
option -F or -C, which are mutually exclusive. Force Output
Mode (option -F) forces the return of a fresh resource. The
resource is output on stdout if and only if the server
responds with 200. If the response is 304, an error is thrown.
responds with 200. If the response is 304, the script silently
fails with exit code 1.
Cache Only Mode (option -C) bypasses the GET request altogether
and goes directly to cache. If the resource resides in cache,
it is output on stdout, otherwise an error is thrown.
it is output on stdout, otherwise the script silently fails
with exit code 1.
Option -o specifies an output file in the local file system.
If option -o is omitted, the transformed document is written
Expand Down Expand Up @@ -178,7 +180,6 @@ if [ -z "$CACHE_DIR" ]; then
exit 2
fi
if [ ! -d "$CACHE_DIR" ]; then
# think carefully about this...
/bin/mkdir "$CACHE_DIR"
exit_code=$?
if [ $exit_code -ne 0 ]; then
Expand Down Expand Up @@ -231,6 +232,7 @@ else
TMP_DIR="${tmp_dir%%/}/${script_name%%.*}"
$verbose_mode && printf "$script_name creating temp dir: %s\n" "$TMP_DIR"
fi
# create a subdirectory
if [ ! -d "$TMP_DIR" ]; then
/bin/mkdir "$TMP_DIR"
exit_code=$?
Expand Down Expand Up @@ -271,6 +273,7 @@ if [ $exit_code -ne 0 ]; then
fi
$verbose_mode && printf "$script_name successfully executed xsltproc\n"

# output the transformed document
if [ -z "$out_file" ]; then
/bin/cat "$xsltproc_out_file"
exit_code=$?
Expand Down

0 comments on commit 6198803

Please sign in to comment.