Don't call it if the target directory already exists. Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com> --- scripts/make-erofs.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/make-erofs.sh b/scripts/make-erofs.sh index 93cb3245f409b24c24be05e9307a1b2e12c867fe..66abd1f388524c19cd3a1113415892d0d72e3f82 100755 --- a/scripts/make-erofs.sh +++ b/scripts/make-erofs.sh @@ -86,12 +86,12 @@ while read -r arg1; do # Create the parent directory if it doesn't already # exist. parent=${arg2%/*} + if [ ! -d "$root/$parent" ]; then + mkdir -p -- "$root/$parent" + fi ;; - (*) - parent=. - ;; + (*) :;; # parent $root which definitely exists esac - mkdir -p -- "$root/$parent" cp -RT -- "$arg1" "$root/$arg2" done -- 2.51.0