mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 23:43:30 +00:00
dart.fetch-dart-deps: Don't delete .git/pub-packages
This commit is contained in:
parent
88275ca6d6
commit
0e5db63dc3
@ -107,7 +107,12 @@ let
|
||||
|
||||
# Remove Git directories in the Git package cache - these are rarely used by Pub,
|
||||
# which instead maintains a corresponsing mirror and clones cached packages through it.
|
||||
find "$PUB_CACHE" -name .git -type d -prune -exec rm -rf {} +
|
||||
#
|
||||
# An exception is made to keep .git/pub-packages files, which are important.
|
||||
# https://github.com/dart-lang/pub/blob/c890afa1d65b340fa59308172029680c2f8b0fc6/lib/src/source/git.dart#L621
|
||||
if [ -d "$PUB_CACHE"/git ]; then
|
||||
find "$PUB_CACHE"/git -maxdepth 4 -path "*/.git/*" ! -name "pub-packages" -prune -exec rm -rf {} +
|
||||
fi
|
||||
|
||||
# Remove continuously updated package metadata caches
|
||||
rm -rf "$PUB_CACHE"/hosted/*/.cache # Not pinned by pubspec.lock
|
||||
|
Loading…
Reference in New Issue
Block a user