diff options
| author | Coelacanthus <[email protected]> | 2021-10-25 18:22:20 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-25 18:22:20 +0800 |
| commit | c7ac4208afc9f4c0c7e100d627fef7d47d0b885b (patch) | |
| tree | 25b179225c1aa6eeea2a9067c20ceff392ec4867 /repodb.sh | |
| parent | 9c42d75e17ea62786581376ff627036fd63311ef (diff) | |
refactor(script): add fast-fail and clean-up (#5)
Signed-off-by: Coelacanthus <[email protected]>
Diffstat (limited to 'repodb.sh')
| -rwxr-xr-x | repodb.sh | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -1,5 +1,20 @@ #!/bin/bash +# end up when failed +set -Eeuo pipefail + +# clean up when exit +trap cleanup SIGINT SIGTERM ERR EXIT +cleanup() { + trap - SIGINT SIGTERM ERR EXIT + unset ARCH + unset PKGDEST + unset REPO_DEST + unset GPG_KEY + unset PACKAGE_NAME + unset LATEST +} + REPO_BASE_NAME="kunoisayami" ARCH=$(uname -m) PKGDEST="${PWD}/packages/$ARCH" @@ -13,10 +28,3 @@ while read PACKAGE_NAME; do fi repo-add "$REPO_DEST" "$PACKAGENAME" -s -v -R -k $GPG_KEY done - -unset ARCH -unset PKGDEST -unset REPO_DEST -unset GPG_KEY -unset PACKAGE_NAME -unset LATEST
\ No newline at end of file |
