diff options
Diffstat (limited to 'brep/submit/submit-dir.in')
-rw-r--r-- | brep/submit/submit-dir.in | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/brep/submit/submit-dir.in b/brep/submit/submit-dir.in index ce8f134..31ae85d 100644 --- a/brep/submit/submit-dir.in +++ b/brep/submit/submit-dir.in @@ -4,16 +4,15 @@ # copyright : Copyright (c) 2014-2018 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -# Package submission handler example. +# Simple package submission handler with directory storage. # # Validate the package archive located in the specified submission directory -# extracting and parsing the package manifest. Remove the submission directory -# if simulating. Write the submission result manifest to stdout. +# extracting and parsing the package manifest (saved as package.manifest in +# the submission directory). Keep the submission directory unless simulating. +# Write the submission result manifest to stdout. # usage="usage: $0 <dir>" -# Diagnostics. -# verbose=true trap "{ exit 1; }" ERR @@ -24,6 +23,18 @@ set -o errtrace # Trap ERR in functions. @import brep/submit/submit@ +# Submission data directory (last argument). +# +dir="${!#/}" + +if [ -z "$dir" ]; then + error "$usage" +fi + +if [ ! -d "$dir" ]; then + error "'$dir' does not exist or is not a directory" +fi + # Parse the submission request manifest and obtain the archive path as well # as the simulate value. # |