Skip to content

Commit 47f43b2

Browse files
Fixes issue with file paths. Closes #196 (#203)
1 parent 11f03b1 commit 47f43b2

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

msgraph-developer-proxy-plugins/MockResponses/MockResponsePlugin.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ public MockResponsePlugin() {
3434
_noMocks = new Option<bool?>("--no-mocks", "Disable loading mock requests");
3535
_noMocks.AddAlias("-n");
3636
_noMocks.ArgumentHelpName = "no mocks";
37-
_noMocks.SetDefaultValue(null);
3837

3938
_mocksFile = new Option<string?>("--mocks-file", "Provide a file populated with mock responses");
4039
_mocksFile.ArgumentHelpName= "mocks file";
41-
_mocksFile.SetDefaultValue(null);
4240
}
4341

4442
public override void Register(IPluginEvents pluginEvents,

msgraph-developer-proxy-plugins/MockResponses/MockResponsesLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void InitResponsesWatcher() {
4646
}
4747

4848
string path = Path.GetDirectoryName(_responsesFilePath) ?? throw new InvalidOperationException($"{_responsesFilePath} is an invalid path");
49-
_watcher = new FileSystemWatcher(path);
49+
_watcher = new FileSystemWatcher(Path.GetFullPath(path));
5050
_watcher.NotifyFilter = NotifyFilters.CreationTime
5151
| NotifyFilters.FileName
5252
| NotifyFilters.LastWrite

msgraph-developer-proxy-plugins/RequestLogs/ExecutionSummaryPlugin.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,14 @@ public ExecutionSummaryPlugin()
4545
return;
4646
}
4747

48-
var outputDir = Path.GetFullPath(Path.GetDirectoryName(outputFilePath));
48+
var dirName = Path.GetDirectoryName(outputFilePath);
49+
if (string.IsNullOrEmpty(dirName))
50+
{
51+
// current directory exists so no need to check
52+
return;
53+
}
54+
55+
var outputDir = Path.GetFullPath(dirName);
4956
if (!Directory.Exists(outputDir))
5057
{
5158
input.ErrorMessage = $"The directory {outputDir} does not exist.";

0 commit comments

Comments
 (0)