diff options
-rwxr-xr-x | pbs-convert-absgit | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/pbs-convert-absgit b/pbs-convert-absgit index 22539d3..9e82330 100755 --- a/pbs-convert-absgit +++ b/pbs-convert-absgit @@ -1,14 +1,12 @@ #!/bin/bash -euE +. libremessages + cmd="${0##*/}" -export TMPDIR="`mktemp -d --tmpdir ${cmd}.XXXXXXXXXX`" cleanup() { msg "$(gettext "Removing temporary files...")" echo rm -rf "$TMPDIR" } -trap cleanup EXIT - -. libremessages abort() { echo # force a fresh line @@ -192,8 +190,12 @@ usage() { } main() { + in_array '-h' "$@" && { usage; return 0; } + [[ $# = 1 ]] || { usage >&2; return 1; } + + export TMPDIR="`mktemp -d --tmpdir ${cmd}.XXXXXXXXXX`" trap abort EXIT - [[ $# = 1 ]] || { usage; return 1; } + local source=$1 local cache="$(pbs-plumb-config get core.cachedir)/${source}.git" |