Verified Commit 556dc5d1 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Fix link issue in copy_dir when link target exists

parent e5384691
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
#!/bin/bash
# Copyright (c) 2020, 2022 Dom Sekotill <dom.sekotill@kodo.org.uk>
# Copyright (c) 2020, 2022, 2024 Dom Sekotill <dom.sekotill@kodo.org.uk>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -109,8 +109,9 @@ copy_dirs() {
	if [[ -h $1 ]]; then
		copy_link "$1"
	elif [[ -d $1 ]]; then
		# copy_dirs may create a link to an existing tree, so use `mkdir -p`
		copy_dirs "$(dirname "$1")"
		mkdir "$STAGE/$1"
		mkdir -p "$STAGE/$1"
	else
		echo >&2 "$1 does not appear to be a directory"
		exit 2