Skip to content

Commit

Permalink
debugging exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
credfeto committed Feb 19, 2024
1 parent 9d0f443 commit e18e185
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ private static bool HasAdditionalFiles(string templatePath, string repoPath, str
}

IEnumerable<string> repoFiles = GetFiles(basePath: repoPath, searchPattern: searchPattern)
.WithoutPrefix(repoPath.Length + 1);
.WithoutPrefix(repoPath.Length);
IEnumerable<string> templateFiles = GetFiles(basePath: templatePath, searchPattern: searchPattern)
.WithoutPrefix(templatePath.Length + 1);
.WithoutPrefix(templatePath.Length);

return repoFiles.Except(second: templateFiles, comparer: StringComparer.Ordinal)
.Any();
Expand Down Expand Up @@ -152,12 +152,11 @@ private static IEnumerable<string> WithoutPrefix(this IEnumerable<string> source

public static bool HasNpmAndYarn(this in RepoContext repoContext, [NotNullWhen(true)] out IReadOnlyList<string>? directories)
{
int prefix = repoContext.WorkingDirectory.Length + 1;
IReadOnlyList<string> dirs =
[
..repoContext.GetFiles("package.json")
.GetDirectoriesOfFiles()
.WithoutPrefix(prefix)
.WithoutPrefix(repoContext.WorkingDirectory.Length)
];

if (dirs is [])
Expand Down

0 comments on commit e18e185

Please sign in to comment.