always get absolute outputpath
This commit is contained in:
parent
e6e259ed47
commit
a84450cd5e
@ -136,13 +136,19 @@ namespace RedundancyFinderCLI
|
|||||||
|
|
||||||
var json = JsonConvert.SerializeObject(finder.Redundancies, Formatting.Indented);
|
var json = JsonConvert.SerializeObject(finder.Redundancies, Formatting.Indented);
|
||||||
|
|
||||||
|
var outputPath = settings.OutputPath;
|
||||||
|
//check if path is relative or absolute
|
||||||
|
if (!Path.IsPathRooted(settings.OutputPath))
|
||||||
|
{
|
||||||
|
outputPath = Path.Combine(Directory.GetCurrentDirectory(), outputPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
File.WriteAllText(settings.OutputPath, json);
|
File.WriteAllText(outputPath, json);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AnsiConsole.MarkupLine($"[yellow]Wrote [/]{finder.Redundancies.Count}[yellow] redundancies to [/]'{settings.OutputPath}'");
|
AnsiConsole.MarkupLine($"[yellow]Wrote [/]{finder.Redundancies.Count}[yellow] redundancies to [/]'{outputPath}'");
|
||||||
|
|
||||||
|
|
||||||
ulong totalSize = finder.Redundancies.Select(x => (ulong)x.Value.FileSize).Aggregate((a, b) => a + b);
|
ulong totalSize = finder.Redundancies.Select(x => (ulong)x.Value.FileSize).Aggregate((a, b) => a + b);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"profiles": {
|
"profiles": {
|
||||||
"RedundancyFinderCLI": {
|
"RedundancyFinderCLI": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"commandLineArgs": "C:\\ -v"
|
"commandLineArgs": "C:\\Users\\daskn\\Pictures\\ -v"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user