mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Fixed default channel when using cross-compile directive (#161)
This commit is contained in:
@@ -5,7 +5,7 @@ public class LinuxPackCommand : PackCommand
|
||||
public string Categories { get; private set; }
|
||||
|
||||
public LinuxPackCommand()
|
||||
: base("pack", "Create a Linux .AppImage bundle from application files.")
|
||||
: base("pack", "Create a Linux .AppImage bundle from application files.", RuntimeOs.Linux)
|
||||
{
|
||||
this.RemoveOption(NoPortableOption);
|
||||
this.RemoveOption(NoInstOption);
|
||||
|
||||
@@ -16,7 +16,7 @@ public class OsxBundleCommand : PackCommand
|
||||
}
|
||||
|
||||
public OsxBundleCommand(string name, string description)
|
||||
: base(name, description)
|
||||
: base(name, description, RuntimeOs.OSX)
|
||||
{
|
||||
IconOption.RequiresExtension(".icns");
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ public class WindowsPackCommand : PackCommand
|
||||
public string Shortcuts { get; private set; }
|
||||
|
||||
public WindowsPackCommand()
|
||||
: base("pack", "Creates a release from a folder containing application files.")
|
||||
: base("pack", "Creates a release from a folder containing application files.", RuntimeOs.Windows)
|
||||
{
|
||||
EntryExecutableNameOption.RequiresExtension(".exe");
|
||||
IconOption.RequiresExtension(".ico");
|
||||
|
||||
@@ -12,7 +12,7 @@ public abstract class OutputCommand : BaseCommand
|
||||
|
||||
protected CliOption<string> ChannelOption { get; private set; }
|
||||
|
||||
protected OutputCommand(string name, string description)
|
||||
protected OutputCommand(string name, string description, RuntimeOs targetOs = RuntimeOs.Unknown)
|
||||
: base(name, description)
|
||||
{
|
||||
ReleaseDirectoryOption = AddOption<DirectoryInfo>((v) => ReleaseDir = v.ToFullNameOrNull(), "-o", "--outputDir")
|
||||
@@ -24,7 +24,7 @@ public abstract class OutputCommand : BaseCommand
|
||||
.SetDescription("The channel to use for this release.")
|
||||
.RequiresValidNuGetId()
|
||||
.SetArgumentHelpName("NAME")
|
||||
.SetDefault(ReleaseEntryHelper.GetDefaultChannel(VelopackRuntimeInfo.SystemOs));
|
||||
.SetDefault(ReleaseEntryHelper.GetDefaultChannel(targetOs == RuntimeOs.Unknown ? VelopackRuntimeInfo.SystemOs : targetOs));
|
||||
}
|
||||
|
||||
public DirectoryInfo GetReleaseDirectory()
|
||||
|
||||
@@ -53,8 +53,8 @@ public abstract class PackCommand : PlatformCommand
|
||||
|
||||
protected CliOption<bool> NoInstOption { get; private set; }
|
||||
|
||||
public PackCommand(string name, string description)
|
||||
: base(name, description)
|
||||
public PackCommand(string name, string description, RuntimeOs targetOs = RuntimeOs.Unknown)
|
||||
: base(name, description, targetOs)
|
||||
{
|
||||
PackIdOption = AddOption<string>((v) => PackId = v, "--packId", "-u")
|
||||
.SetDescription("Unique Id for application bundle.")
|
||||
|
||||
@@ -6,7 +6,7 @@ public abstract class PlatformCommand : OutputCommand
|
||||
|
||||
protected CliOption<string> TargetRuntimeOption { get; private set; }
|
||||
|
||||
protected PlatformCommand(string name, string description) : base(name, description)
|
||||
protected PlatformCommand(string name, string description, RuntimeOs targetOs = RuntimeOs.Unknown) : base(name, description, targetOs)
|
||||
{
|
||||
TargetRuntimeOption = AddOption<string>((v) => TargetRuntime = v, "-r", "--runtime")
|
||||
.SetDescription("The target runtime to build packages for.")
|
||||
|
||||
Reference in New Issue
Block a user