diff options
Diffstat (limited to 'src/abslibre-tools/createworkdir')
-rwxr-xr-x | src/abslibre-tools/createworkdir | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/src/abslibre-tools/createworkdir b/src/abslibre-tools/createworkdir index 80b2d5e..e3e4143 100755 --- a/src/abslibre-tools/createworkdir +++ b/src/abslibre-tools/createworkdir @@ -27,28 +27,33 @@ set -euE . "$(librelib messages)" . "$(librelib conf)" -load_files libretools -check_vars libretools WORKDIR ABSLIBRERECV ABSLIBRESEND # these are asked for by `xbs download` -trap 'error "Aborting..."' EXIT +main() { + load_files libretools + check_vars libretools WORKDIR ABSLIBRERECV ABSLIBRESEND # these are asked for by `xbs download` -msg "Creating WORKDIR at %s..." "$WORKDIR" -mkdir -p "$WORKDIR" + trap 'error "Aborting..."' EXIT -msg "Creating staging directory in WORKDIR..." -mkdir -p "$WORKDIR/staging" + msg "Creating WORKDIR at %s..." "$WORKDIR" + mkdir -p "$WORKDIR" -cmd=(xbs -b abslibre download) -if ! "${cmd[@]}"; then - error "Could not clone ABSLibre" - plain "Try running this command:" - echo - printf '%q ' "${cmd[@]}" - echo - exit 1 -fi + msg "Creating staging directory in WORKDIR..." + mkdir -p "$WORKDIR/staging" -msg "Finished, your packaging directory tree looks like this now:" -ls --color=auto "${WORKDIR}"/* + cmd=(xbs -b abslibre download) + if ! "${cmd[@]}"; then + error "Could not clone ABSLibre" + plain "Try running this command:" + echo + printf '%q ' "${cmd[@]}" + echo + exit 1 + fi -trap -- EXIT + msg "Finished, your packaging directory tree looks like this now:" + ls --color=auto "${WORKDIR}"/* + + trap -- EXIT +} + +main "$@" |