C#: Use -p: instead of /p: with dotnet

Makes a difference for `dotnet run` where the option will otherwise be considered
an argument to the program that is run.
This commit is contained in:
Tom Hvitved
2022-09-05 10:40:00 +02:00
parent 623ba7926f
commit d8b352c2e6

View File

@@ -16,7 +16,7 @@ function RegisterExtractorPack(id)
-- For now, parse the command line as follows: -- For now, parse the command line as follows:
-- Everything that starts with `-` (or `/`) will be ignored. -- Everything that starts with `-` (or `/`) will be ignored.
-- The first non-option argument is treated as the command. -- The first non-option argument is treated as the command.
-- if that's `build`, we append `/p:UseSharedCompilation=false` to the command line, -- if that's `build`, we append `-p:UseSharedCompilation=false` to the command line,
-- otherwise we do nothing. -- otherwise we do nothing.
local match = false local match = false
local needsSeparator = false; local needsSeparator = false;
@@ -37,7 +37,7 @@ function RegisterExtractorPack(id)
break break
end end
if arg == 'run' then if arg == 'run' then
-- for `dotnet run`, we need to make sure that `/p:UseSharedCompilation=false` is -- for `dotnet run`, we need to make sure that `-p:UseSharedCompilation=false` is
-- not passed in as an argument to the program that is run -- not passed in as an argument to the program that is run
match = true match = true
needsSeparator = true needsSeparator = true
@@ -49,7 +49,7 @@ function RegisterExtractorPack(id)
end end
end end
if match then if match then
local injections = { '/p:UseSharedCompilation=false' } local injections = { '-p:UseSharedCompilation=false' }
if needsSeparator then if needsSeparator then
table.insert(injections, '--') table.insert(injections, '--')
end end