File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
msgraph-developer-proxy-plugins Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,9 @@ public MockResponsePlugin() {
34
34
_noMocks = new Option < bool ? > ( "--no-mocks" , "Disable loading mock requests" ) ;
35
35
_noMocks . AddAlias ( "-n" ) ;
36
36
_noMocks . ArgumentHelpName = "no mocks" ;
37
- _noMocks . SetDefaultValue ( null ) ;
38
37
39
38
_mocksFile = new Option < string ? > ( "--mocks-file" , "Provide a file populated with mock responses" ) ;
40
39
_mocksFile . ArgumentHelpName = "mocks file" ;
41
- _mocksFile . SetDefaultValue ( null ) ;
42
40
}
43
41
44
42
public override void Register ( IPluginEvents pluginEvents ,
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public void InitResponsesWatcher() {
46
46
}
47
47
48
48
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 ) ) ;
50
50
_watcher . NotifyFilter = NotifyFilters . CreationTime
51
51
| NotifyFilters . FileName
52
52
| NotifyFilters . LastWrite
Original file line number Diff line number Diff line change @@ -45,7 +45,14 @@ public ExecutionSummaryPlugin()
45
45
return ;
46
46
}
47
47
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 ) ;
49
56
if ( ! Directory . Exists ( outputDir ) )
50
57
{
51
58
input . ErrorMessage = $ "The directory { outputDir } does not exist.";
You can’t perform that action at this time.
0 commit comments