Skip to content

Commit

Permalink
VCI-819: Skip node_modules in Backup target (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
krankenbro authored Mar 20, 2024
1 parent 14baa24 commit a1ffbf5
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,15 @@ private static bool PlatformVersionChanged
modulesDirs = Directory.EnumerateDirectories(discoveryPath).ToList();
}
var symlinks = modulesDirs.Where(m => new DirectoryInfo(m).LinkTarget != null).ToList();
CompressionExtensions.TarGZipTo(RootDirectory, BackupFile, filter: f => !f.ToFileInfo().FullName.StartsWith(RootDirectory / ".nuke") && !symlinks.Exists(s => f.ToFileInfo().FullName.StartsWith(s)));
CompressionExtensions.TarGZipTo(RootDirectory, BackupFile, filter: f => !SkipFile(f.ToFileInfo()) && !symlinks.Exists(s => f.ToFileInfo().FullName.StartsWith(s)));
});

private static bool SkipFile(FileInfo fileInfo)
{
const string nodeModules = "node_modules";
return fileInfo.FullName.StartsWith(RootDirectory / ".nuke") || fileInfo.FullName.Contains(nodeModules);
}

public bool ThereAreFailedTargets => FailedTargets.Count > 0 && SucceededTargets.Contains(Backup);
public Target Rollback => _ => _
.DependsOn(Backup)
Expand Down

0 comments on commit a1ffbf5

Please sign in to comment.