mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-07-09 02:07:47 +00:00
#697 fixing conflicts in ElectronNET.CLI commands
This commit is contained in:
@@ -44,6 +44,7 @@ namespace ElectronNET.CLI.Commands
|
||||
private string _paramDotNetConfig = "dotnet-configuration";
|
||||
private string _paramElectronArch = "electron-arch";
|
||||
private string _paramElectronParams = "electron-params";
|
||||
private string _paramElectronVersion = "electron-version";
|
||||
private string _paramOutputDirectory = "relative-path";
|
||||
private string _paramAbsoluteOutput = "absolute-path";
|
||||
private string _paramPackageJson = "package-json";
|
||||
@@ -120,11 +121,7 @@ namespace ElectronNET.CLI.Commands
|
||||
}
|
||||
|
||||
var command =
|
||||
<<<<<<< HEAD
|
||||
$"dotnet publish {project} -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {string.Join(' ', dotNetPublishFlags.Select(kvp => $"{kvp.Key}={kvp.Value}"))} --self-contained";
|
||||
=======
|
||||
$"dotnet publish -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {string.Join(' ', dotNetPublishFlags.Select(kvp => $"{kvp.Key}={kvp.Value}"))}";
|
||||
>>>>>>> 5338749e4d2b0fcd9c46bad1a61e5c7d7d0f18cc
|
||||
$"dotnet publish {project} -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {string.Join(' ', dotNetPublishFlags.Select(kvp => $"{kvp.Key}={kvp.Value}"))}";
|
||||
|
||||
// add any additional dotnet flags
|
||||
var dotnetFlags = GetDotNetArgs(parser);
|
||||
@@ -147,8 +144,7 @@ namespace ElectronNET.CLI.Commands
|
||||
}
|
||||
|
||||
DeployEmbeddedElectronFiles.Do(tempPath);
|
||||
var nodeModulesDirPath = Path.Combine(tempPath, "node_modules");
|
||||
|
||||
|
||||
if (parser.Arguments.ContainsKey(_paramPackageJson))
|
||||
{
|
||||
Console.WriteLine("Copying custom package.json.");
|
||||
@@ -243,9 +239,6 @@ namespace ElectronNET.CLI.Commands
|
||||
});
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
internal static Dictionary<string, string> GetDotNetPublishFlags(SimpleCommandLineParser parser, string defaultReadyToRun, string defaultSingleFile)
|
||||
=======
|
||||
private static List<string> DotNetFlagsWithValuesReserved = new List<string>
|
||||
{
|
||||
"-o", "--output", "-r", "--runtime", "-c", "--configuration"
|
||||
@@ -281,8 +274,7 @@ namespace ElectronNET.CLI.Commands
|
||||
return list;
|
||||
}
|
||||
|
||||
private Dictionary<string, string> GetDotNetPublishFlags(SimpleCommandLineParser parser)
|
||||
>>>>>>> 5338749e4d2b0fcd9c46bad1a61e5c7d7d0f18cc
|
||||
internal static Dictionary<string, string> GetDotNetPublishFlags(SimpleCommandLineParser parser, string defaultReadyToRun, string defaultSingleFile)
|
||||
{
|
||||
var dotNetPublishFlags = new Dictionary<string, string>
|
||||
{
|
||||
|
||||
@@ -27,8 +27,6 @@ namespace ElectronNET.CLI.Commands
|
||||
private string _arguments = "args";
|
||||
private string _manifest = "manifest";
|
||||
private string _clearCache = "clear-cache";
|
||||
private string _paramPublishReadyToRun = "PublishReadyToRun";
|
||||
private string _paramPublishSingleFile = "PublishSingleFile";
|
||||
private string _paramDotNetConfig = "dotnet-configuration";
|
||||
private string _paramTarget = "target";
|
||||
|
||||
@@ -56,14 +54,6 @@ namespace ElectronNET.CLI.Commands
|
||||
aspCoreProjectPath = Directory.GetCurrentDirectory();
|
||||
}
|
||||
|
||||
|
||||
bool buildInsteadOfPublish = false;
|
||||
|
||||
if (parser.Arguments.ContainsKey(_buildInsteadOfPublish))
|
||||
{
|
||||
buildInsteadOfPublish = bool.Parse(parser.Arguments[_buildInsteadOfPublish].First());
|
||||
}
|
||||
|
||||
string tempPath = Path.Combine(aspCoreProjectPath, "obj", "Host");
|
||||
if (Directory.Exists(tempPath) == false)
|
||||
{
|
||||
@@ -98,31 +88,15 @@ namespace ElectronNET.CLI.Commands
|
||||
configuration = parser.Arguments[_paramDotNetConfig][0];
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (!buildInsteadOfPublish)
|
||||
{
|
||||
if (parser != null && !parser.Arguments.ContainsKey("watch"))
|
||||
{
|
||||
resultCode = ProcessHelper.CmdExecute($"dotnet publish -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {string.Join(' ', dotNetPublishFlags.Select(kvp => $"{kvp.Key}={kvp.Value}"))} --no-self-contained /p:DisabledWarnings=true", aspCoreProjectPath);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (parser != null && !parser.Arguments.ContainsKey("watch"))
|
||||
{
|
||||
resultCode = ProcessHelper.CmdExecute($"dotnet build -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {string.Join(' ', dotNetPublishFlags.Select(kvp => $"{kvp.Key}={kvp.Value}"))} /p:DisabledWarnings=true", aspCoreProjectPath);
|
||||
}
|
||||
=======
|
||||
var project = string.Empty;
|
||||
if (parser.Arguments.ContainsKey(_paramDotNetProject))
|
||||
{
|
||||
project = parser.Arguments[_paramDotNetProject][0];
|
||||
}
|
||||
|
||||
if (parser != null && !parser.Arguments.ContainsKey("watch"))
|
||||
if (!parser.Arguments.ContainsKey("watch"))
|
||||
{
|
||||
resultCode = ProcessHelper.CmdExecute($"dotnet publish {project} -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {publishReadyToRun} {publishSingleFile} --no-self-contained", aspCoreProjectPath);
|
||||
>>>>>>> 2331ef43b4c2028c57564f3a8c885555c81661d4
|
||||
resultCode = ProcessHelper.CmdExecute($"dotnet publish {project} -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {string.Join(' ', dotNetPublishFlags.Select(kvp => $"{kvp.Key}={kvp.Value}"))} /p:DisabledWarnings=true", aspCoreProjectPath);
|
||||
}
|
||||
|
||||
if (resultCode != 0)
|
||||
|
||||
Reference in New Issue
Block a user