diff options
author | Adriana Kobylak <anoo@us.ibm.com> | 2019-06-05 14:10:27 -0500 |
---|---|---|
committer | Adriana Kobylak <anoo@us.ibm.com> | 2019-06-10 12:11:49 -0500 |
commit | 8004ff59269e33e19af20a69db08d0f224fb403e (patch) | |
tree | cccc9735fd2e7e435d576d2e05f131c0827c9240 | |
parent | b8cb0cc9d9b3253df47bf019a8f028f01110f9ab (diff) | |
download | openpower-pnor-code-mgmt-8004ff59269e33e19af20a69db08d0f224fb403e.tar.gz openpower-pnor-code-mgmt-8004ff59269e33e19af20a69db08d0f224fb403e.zip |
generate-tar: Always remove scratch dir
Add a trap to generate-tar to remove the scratch dir on exit,
otherwise the scratch dir was not being removed if the script
failed before it reached the end where the rm command was.
Tested: Verified the scratch dir was removed on failure.
Change-Id: I177201976d19d5b7a44a909090739f7e74f75320
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rwxr-xr-x | generate-tar | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/generate-tar b/generate-tar index d90aefa42..f0b94a939 100755 --- a/generate-tar +++ b/generate-tar @@ -124,6 +124,7 @@ fi scratch_dir=`mktemp -d` +trap "{ rm -r ${scratch_dir}; }" EXIT if [[ "${do_sign}" == true ]]; then if [[ -z "${private_key_path}" ]]; then @@ -243,4 +244,3 @@ else echo "Static layout tarball at $outfile" fi -rm -r "${scratch_dir}" |