Skip to content

Commit

Permalink
💾 Feat(Publisher): Available to ignore .packignore file when it not…
Browse files Browse the repository at this point in the history
… exists
  • Loading branch information
Dynesshely committed Sep 28, 2024
1 parent 3d81b0d commit a1a3e31
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .cheese/scripts/publish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
Directory.CreateDirectory(logsDir);

var packIgnore = $"{publishDir}/.packignore".GetFullPath();
var packIgnoreExists = File.Exists(packIgnore);

var finishedThreads = 0;
var executingThreadIndex = 0;
Expand Down Expand Up @@ -116,9 +117,14 @@
{
AnsiConsole.MarkupLine($"{prompt} Begin packing.");
if (packIgnoreExists)
AnsiConsole.MarkupLine($"{prompt} `.packignore` not exists, all folder will be packed.");
packTask.IsIndeterminate = false;
var ignoredDirectories = JsonSerializer.Deserialize<List<string>>(File.ReadAllText(packIgnore));
var ignoredDirectories = packIgnoreExists
? JsonSerializer.Deserialize<List<string>>(File.ReadAllText(packIgnore))
: new List<string>();
var folders = new DirectoryInfo(publishDir).GetDirectories().ToList();
Expand Down

0 comments on commit a1a3e31

Please sign in to comment.