Closed ghost closed 3 years ago
Looks like it's happening somewhere around here in the Run
function...
void projectReferenceCommand(string command, string project, string reference) =>
DotNet($"{command} {project.Escape()} reference {reference.Escape()}");
(string[] dependents, string[] dependencies) analyzeReferences()
{
Log(
"Analyzing references in your projects - depending on the number of projects this can take a bit...");
return (
allProjects().Where(doesNotEqualOldProjectPath).Where(hasReferenceToOldProject).ToArray(),
getReferencedProjects(oldProjectPath).ToArray());
bool hasReferenceToOldProject(string p) =>
getReferencedProjects(p).Any(doesEqualOldProjectPath);
}
bool doesNotEqualOldProjectPath(string what) => !doesEqualOldProjectPath(what);
bool doesEqualOldProjectPath(string what) => arePathsEqual(what, oldProjectPath);
IEnumerable<string> getReferencedProjects(string project)
{
var baseDirectory = Path.GetFullPath(Path.GetDirectoryName(project));
var relativeReferences = DotNetRead($"list {project} reference")
.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries)
.Skip(2);
return relativeReferences.Select(r => r.ToAbsolutePath(baseDirectory));
}
thanks for finding! a new version is out :-)
Glad it was a one-liner! Thanks!
Hey there!
I saw you said you'd fixed this issue in 2.1.1, but I don't believe it's fixed based on the error I'm seeing:
Unfortunately, my user folder has a space in it, and it looks like the path is not quoted in the call to
dotnet list
.Thanks!