diff options
author | Leah Rowe <leah@libreboot.org> | 2023-05-18 13:01:12 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-05-18 13:01:12 +0100 |
commit | 3da8d20cd6b5e7e9338d16ce82edca20ede65585 (patch) | |
tree | c6424496c72f4b3afbcbaa5df6008172ccfe69a8 /gitclone | |
parent | e804849486c075b442ba7067dace6e6eb44d20fe (diff) |
gitclone: stricter error handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'gitclone')
-rwxr-xr-x | gitclone | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -25,7 +25,7 @@ main() clone_project # clean in case of failure - rm -rf ${tmp_dir} >/dev/null 2>&1 + rm -rf ${tmp_dir} >/dev/null 2>&1 || exit 1 } read_config() @@ -69,15 +69,15 @@ clone_project() # clean out old version just in case if [ -d "${location}" ]; then - rm -rf ${location} + rm -rf ${location} || exit 1 fi git clone ${url} ${tmp_dir} || git clone ${bkup_url} ${tmp_dir} \ || err "ERROR: could not download ${name}" ( - cd ${tmp_dir} || err "Could not access tmp directory." - git reset --hard ${revision} + cd ${tmp_dir} || exit 1 + git reset --hard ${revision} || err "Cannot reset revision" ) patch_project @@ -96,7 +96,7 @@ patch_project() continue fi ( - cd ${tmp_dir} + cd ${tmp_dir} || exit 1 git am ${patchfile} || err "Cannot patch project: $name" ) done |