mirror of
https://github.com/Stone-Red-Code/ARP-Scanner.git
synced 2026-09-04 00:46:04 +02:00
Allow files paths without directory as output paths
This commit is contained in:
@@ -187,7 +187,10 @@ internal static class Program
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_ = Directory.CreateDirectory(Path.GetDirectoryName(jsonPath) ?? string.Empty);
|
if (!string.IsNullOrWhiteSpace(Path.GetDirectoryName(jsonPath)))
|
||||||
|
{
|
||||||
|
_ = Directory.CreateDirectory(Path.GetDirectoryName(jsonPath)!);
|
||||||
|
}
|
||||||
|
|
||||||
string json = JsonSerializer.Serialize(JsonResult.Parse([.. activeHosts], previouslyActiveHosts), jsonSerializerOptions);
|
string json = JsonSerializer.Serialize(JsonResult.Parse([.. activeHosts], previouslyActiveHosts), jsonSerializerOptions);
|
||||||
File.WriteAllText(jsonPath, json);
|
File.WriteAllText(jsonPath, json);
|
||||||
@@ -216,7 +219,11 @@ internal static class Program
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_ = Directory.CreateDirectory(Path.GetDirectoryName(csvPath) ?? string.Empty);
|
if (!string.IsNullOrWhiteSpace(Path.GetDirectoryName(csvPath)))
|
||||||
|
{
|
||||||
|
_ = Directory.CreateDirectory(Path.GetDirectoryName(csvPath)!);
|
||||||
|
}
|
||||||
|
|
||||||
File.WriteAllLines(csvPath, activeHostsTable.Select(row => string.Join(",", row)));
|
File.WriteAllLines(csvPath, activeHostsTable.Select(row => string.Join(",", row)));
|
||||||
|
|
||||||
if (!options.Silent)
|
if (!options.Silent)
|
||||||
|
|||||||
Reference in New Issue
Block a user