From e3a8a11f7fdc64a560810cf021080c61c7d69dc5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 8 Aug 2018 09:45:48 +0200 Subject: Document submit-git --- brep/submit/submit-dir.in | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'brep/submit/submit-dir.in') 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 " -# 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. # -- cgit v1.1