nix: Allow some build directories to stay in mobile node_modules (for caching)

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
Pedro Pombeiro 2019-07-18 14:22:41 +02:00
parent 75d0af862f
commit 7230897b94
No known key found for this signature in database
GPG Key ID: C4A24185B2AA48A1
1 changed files with 6 additions and 1 deletions

View File

@ -27,7 +27,12 @@ needCopyModules=1
if [ -d "$nodeModulesDir" ]; then
if [ -f "$nodeModulesDir/.copied~" ]; then
echo "Checking for modifications in node_modules..."
modifiedFiles=( $(find $nodeModulesDir -writable -type f -newer $nodeModulesDir/.copied~ -not \( -path "$nodeModulesDir/react-native/third-party/*" -prune -o -path './resources/icons/*' -prune \) -print) )
modifiedFiles=( $(find $nodeModulesDir -writable -type f -newer $nodeModulesDir/.copied~ \
-not \( -path "$nodeModulesDir/react-native/third-party/*" -prune \
-o -path "$nodeModulesDir/react-native/ReactAndroid/build/*" -prune \
-o -path "$nodeModulesDir/*/android/build/*" -prune \
-o -path "$nodeModulesDir/realm/src/*" -prune \
-o -path './resources/icons/*' -prune \) -print) )
if [ ${#modifiedFiles[@]} -eq 0 ]; then
needCopyModules=0
echo "No modifications detected."