summaryrefslogtreecommitdiff
path: root/script/update/project
diff options
context:
space:
mode:
authorRiku Viitanen <riku.viitanen@protonmail.com>2023-09-08 00:25:52 +0300
committerRiku Viitanen <riku.viitanen@protonmail.com>2023-09-08 00:25:58 +0300
commit4d3b16da38cf7806ebc247ce9c15f11b91ebcf19 (patch)
treea0c56f24b534631556ce6307cc47dae9d88ad58c /script/update/project
parent7e8465bec86805e5d6d67d348d811a09243d3b9c (diff)
Cleaner parent directory creation
My previous patch b0rked memtest and others because when making sure their parent directory (the project root) exists, it would instead create the project directory (memtest86lus). The later move would then put the git repo inside that (memtest86plus/memtest86plus_123456). We just need to make sure we don't create the target directory itself. This way, there's no need to hardcode any project names. Tested by ./updating rpi-pico-serprog, memtest86plus, grub and seabios. Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
Diffstat (limited to 'script/update/project')
-rwxr-xr-xscript/update/project/repo4
1 files changed, 2 insertions, 2 deletions
diff --git a/script/update/project/repo b/script/update/project/repo
index 24bd14ce..a5e8ef62 100755
--- a/script/update/project/repo
+++ b/script/update/project/repo
@@ -85,8 +85,8 @@ clone_project()
[ ! -d "${location}" ] || \
rm -Rf "${location}" || \
fail "clone_project: Can't remove directory '${location}'"
- [ "${name}" != "rpi-pico-serprog" ] || mkdir -p ${location%/*} || \
- fail "clone_project: cannot make directory for rpi-pico-serprog"
+ [ "${location}" = "${location%/*}" ] || mkdir -p ${location%/*} || \
+ fail "clone_project: cannot make directory for ${name}"
mv "${tmp_dir}" "${location}" || \
fail "clone_project: could not copy temp file to destination"
}