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>btrfsvols
parent
7e8465bec8
commit
4d3b16da38
|
@ -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"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue