summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-05-18 13:01:12 +0100
committerLeah Rowe <leah@libreboot.org>2023-05-18 13:01:12 +0100
commit3da8d20cd6b5e7e9338d16ce82edca20ede65585 (patch)
treec6424496c72f4b3afbcbaa5df6008172ccfe69a8
parente804849486c075b442ba7067dace6e6eb44d20fe (diff)
gitclone: stricter error handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rwxr-xr-xgitclone10
1 files changed, 5 insertions, 5 deletions
diff --git a/gitclone b/gitclone
index 20f54453..4630cc6e 100755
--- a/gitclone
+++ b/gitclone
@@ -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