Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Don't log delete failures if "orgiveup" is used; print number of stub…
Browse files Browse the repository at this point in the history
…s created
  • Loading branch information
caesay committed Apr 22, 2022
1 parent 4375875 commit 338fd12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/Squirrel/Internal/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ public static void DeleteFileOrDirectoryHard(string path, bool throwOnFailure =
} else if (Directory.Exists(path)) {
DeleteFsiTree(new DirectoryInfo(path));
} else {
Log().Warn($"Cannot delete '{path}' if it does not exist.");
if (throwOnFailure)
Log().Warn($"Cannot delete '{path}' if it does not exist.");
}
} catch (Exception ex) {
Log().ErrorException($"Unable to delete '{path}'", ex);
Expand Down
9 changes: 5 additions & 4 deletions src/SquirrelCli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,14 @@ RuntimeCpu parseMachine(PeNet.Header.Pe.MachineType machine)
ZipPackage.SetSquirrelMetadata(nuspecPath, pkgarch, requiredFrameworks.Select(r => r.Id));
// create stub executable for all exe's in this package (except Squirrel!)
Log.Info("Creating stub executables");
new DirectoryInfo(pkgPath).GetAllFilesRecursively()
var exesToCreateStubFor = new DirectoryInfo(pkgPath).GetAllFilesRecursively()
.Where(x => x.Name.EndsWith(".exe", StringComparison.InvariantCultureIgnoreCase))
.Where(x => !x.Name.Equals("squirrel.exe", StringComparison.InvariantCultureIgnoreCase))
.Where(x => Utility.IsFileTopLevelInPackage(x.FullName, pkgPath))
.ToArray() // materialize the IEnumerable so we never end up creating stubs for stubs
.ForEach(x => createExecutableStubForExe(x.FullName));
.ToArray(); // materialize the IEnumerable so we never end up creating stubs for stubs
Log.Info($"Creating {exesToCreateStubFor.Length} stub executables");
exesToCreateStubFor.ForEach(x => createExecutableStubForExe(x.FullName));
// sign all exe's in this package
new DirectoryInfo(pkgPath).GetAllFilesRecursively()
Expand Down

0 comments on commit 338fd12

Please sign in to comment.