Skip to content

Commit 76956e3

Browse files
committed
Move a check up
To avoid unnecessary work in failure scenarios.
1 parent 93256ec commit 76956e3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Cli/dotnet/Commands/Run/RunCommand.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ public int Execute()
110110
}
111111
else
112112
{
113-
if (EntryPointFileFullPath is not null)
113+
if (NoCache)
114114
{
115-
projectFactory = CreateVirtualCommand().PrepareProjectInstance().CreateProjectInstance;
115+
throw new GracefulException(CliCommandStrings.InvalidOptionCombination, RunCommandParser.NoCacheOption.Name, RunCommandParser.NoBuildOption.Name);
116116
}
117117

118-
if (NoCache)
118+
if (EntryPointFileFullPath is not null)
119119
{
120-
throw new GracefulException(CliCommandStrings.InvalidOptionCombination, RunCommandParser.NoCacheOption.Name, RunCommandParser.NoBuildOption.Name);
120+
projectFactory = CreateVirtualCommand().PrepareProjectInstance().CreateProjectInstance;
121121
}
122122
}
123123

0 commit comments

Comments
 (0)