mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 14:02:52 +02:00
gitclone: only rm the old directory at the end
this way, it will only be deleted after the new git clone and patching worked successfully Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -67,11 +67,6 @@ clone_project()
|
||||
{
|
||||
tmp_dir=$(mktemp -dt "${name}_XXXXX")
|
||||
|
||||
# clean out old version just in case
|
||||
if [ -d "${location}" ]; then
|
||||
rm -rf ${location} || exit 1
|
||||
fi
|
||||
|
||||
git clone ${url} ${tmp_dir} || git clone ${bkup_url} ${tmp_dir} \
|
||||
|| err "ERROR: could not download ${name}"
|
||||
|
||||
@@ -81,6 +76,10 @@ clone_project()
|
||||
)
|
||||
|
||||
patch_project
|
||||
|
||||
if [ -d "${location}" ]; then
|
||||
rm -Rf ${location} || exit 1
|
||||
fi
|
||||
mv ${tmp_dir} ${location} && return 0
|
||||
|
||||
printf "ERROR: Could not copy temp file to destination.\n"
|
||||
|
||||
Reference in New Issue
Block a user