Skip to content

Commit

Permalink
nix/build: rmdir workaround in submodules.sh
Browse files Browse the repository at this point in the history
sometimes empty directories are kept, perhaps due to regex changes on
newly-generated projects' flakes
  • Loading branch information
PgBiel committed Apr 26, 2024
1 parent e3627e2 commit a3a330b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nix/build/submodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ for submodule in $submodules;
do
subsrc="$(echo "$submodule" | cut -d':' -f1)"
subdest="$(echo "$submodule" | cut -d':' -f2)"

# Remove empty directory in case there was a submodule there
# so the link doesn't fail
rmdir "$subdest" >/dev/null 2>/dev/null || true

mkdir -p "$(dirname "$subdest")"
ln -s "$subsrc" -T "$subdest" || echo "Warning: Failed to link submodule to '$subdest'" >&2
done

0 comments on commit a3a330b

Please sign in to comment.