Browse Source

Merge pull request #14125 from abpframework/issues/14104

Cli: Fix line splitting in SolutionFileModifier
pull/14126/head
Yunus Emre Kalkan 4 years ago
committed by GitHub
parent
commit
9028703116
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionFileModifier.cs

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionFileModifier.cs

@ -51,7 +51,7 @@ public class SolutionFileModifier : ITransientDependency
var srcFolderId = await AddNewFolderAndGetIdOrGetExistingIdAsync(solutionFile, "src"); var srcFolderId = await AddNewFolderAndGetIdOrGetExistingIdAsync(solutionFile, "src");
var solutionFileContent = File.ReadAllText(solutionFile); var solutionFileContent = File.ReadAllText(solutionFile);
var lines = solutionFileContent.Split(Environment.NewLine).ToList(); var lines = solutionFileContent.Split(new[] { Environment.NewLine, "\n" }, StringSplitOptions.None).ToList();
if (lines.Any(l => l.Contains($"\"{package.Name}\""))) if (lines.Any(l => l.Contains($"\"{package.Name}\"")))
{ {
@ -140,7 +140,7 @@ public class SolutionFileModifier : ITransientDependency
await AddNewFolderAndGetIdOrGetExistingIdAsync(solutionFile, "test")); await AddNewFolderAndGetIdOrGetExistingIdAsync(solutionFile, "test"));
var file = File.ReadAllText(solutionFile); var file = File.ReadAllText(solutionFile);
var lines = file.Split(Environment.NewLine).ToList(); var lines = file.Split(new[] { Environment.NewLine, "\n" }, StringSplitOptions.None).ToList();
var projectsUnderModule = Directory.GetFiles( var projectsUnderModule = Directory.GetFiles(
Path.Combine(Path.GetDirectoryName(solutionFile), "modules", module.Name), Path.Combine(Path.GetDirectoryName(solutionFile), "modules", module.Name),
@ -206,7 +206,7 @@ public class SolutionFileModifier : ITransientDependency
string parentFolderId = null) string parentFolderId = null)
{ {
var file = File.ReadAllText(solutionFile); var file = File.ReadAllText(solutionFile);
var lines = file.Split(Environment.NewLine).ToList(); var lines = file.Split(new[] { Environment.NewLine, "\n" }, StringSplitOptions.None).ToList();
string folderId; string folderId;
var folderLineIndex = lines.FindIndex(l => var folderLineIndex = lines.FindIndex(l =>

Loading…
Cancel
Save