mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Wire up new noportable/noinst arguments
This commit is contained in:
@@ -31,4 +31,8 @@ public class LinuxPackOptions : IPackOptions
|
||||
public bool PackIsAppDir { get; set; }
|
||||
|
||||
public string Exclude { get; set; }
|
||||
|
||||
public bool NoPortable { get; set; }
|
||||
|
||||
public bool NoInst { get; set; }
|
||||
}
|
||||
|
||||
@@ -17,4 +17,8 @@ public class WindowsPackOptions : WindowsReleasifyOptions, INugetPackCommand, IP
|
||||
public string ReleaseNotes { get; set; }
|
||||
|
||||
public string Exclude { get; set; }
|
||||
|
||||
public bool NoPortable { get; set; }
|
||||
|
||||
public bool NoInst { get; set; }
|
||||
}
|
||||
|
||||
@@ -7,4 +7,6 @@ public interface IPackOptions : INugetPackCommand, IPlatformOptions
|
||||
string EntryExecutableName { get; }
|
||||
string Icon { get; }
|
||||
string Exclude { get; }
|
||||
bool NoPortable { get; }
|
||||
bool NoInst { get; }
|
||||
}
|
||||
|
||||
@@ -117,11 +117,14 @@ public abstract class PackageBuilder<T> : ICommand<T>
|
||||
});
|
||||
}
|
||||
|
||||
var portableTask = ctx.RunTask("Building portable package", async (progress) => {
|
||||
var suggestedName = ReleaseEntryHelper.GetSuggestedPortableName(packId, channel);
|
||||
var path = getIncompletePath(suggestedName);
|
||||
await CreatePortablePackage(progress, packDirectory, path);
|
||||
});
|
||||
Task portableTask = null;
|
||||
if (!VelopackRuntimeInfo.IsLinux && !Options.NoPortable) {
|
||||
portableTask = ctx.RunTask("Building portable package", async (progress) => {
|
||||
var suggestedName = ReleaseEntryHelper.GetSuggestedPortableName(packId, channel);
|
||||
var path = getIncompletePath(suggestedName);
|
||||
await CreatePortablePackage(progress, packDirectory, path);
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: hack, this is a prerequisite for building full package but only on linux
|
||||
if (VelopackRuntimeInfo.IsLinux) await portableTask;
|
||||
@@ -134,7 +137,7 @@ public abstract class PackageBuilder<T> : ICommand<T>
|
||||
});
|
||||
|
||||
Task setupTask = null;
|
||||
if (VelopackRuntimeInfo.IsWindows || VelopackRuntimeInfo.IsOSX) {
|
||||
if (!Options.NoInst && (VelopackRuntimeInfo.IsWindows || VelopackRuntimeInfo.IsOSX)) {
|
||||
setupTask = ctx.RunTask("Building setup package", async (progress) => {
|
||||
var suggestedName = ReleaseEntryHelper.GetSuggestedSetupName(packId, channel);
|
||||
var path = getIncompletePath(suggestedName);
|
||||
@@ -149,16 +152,10 @@ public abstract class PackageBuilder<T> : ICommand<T>
|
||||
});
|
||||
}
|
||||
|
||||
if (!VelopackRuntimeInfo.IsLinux) await portableTask;
|
||||
if (!VelopackRuntimeInfo.IsLinux && portableTask != null) await portableTask;
|
||||
if (setupTask != null) await setupTask;
|
||||
|
||||
await ctx.RunTask("Post-process steps", (progress) => {
|
||||
var expectedAssets = VelopackRuntimeInfo.IsLinux ? 2 : 3;
|
||||
if (prev != null && options.DeltaMode != DeltaMode.None) expectedAssets += 1;
|
||||
if (filesToCopy.Count != expectedAssets) {
|
||||
throw new Exception($"Expected {expectedAssets} assets to be created, but only {filesToCopy.Count} were.");
|
||||
}
|
||||
|
||||
foreach (var f in filesToCopy) {
|
||||
Utility.MoveFile(f.from, f.to, true);
|
||||
}
|
||||
|
||||
@@ -113,5 +113,7 @@ public abstract class PackCommand : PlatformCommand
|
||||
NoInstOption = AddOption<bool>((v) => NoInst = v, "--noInst")
|
||||
.SetDescription("Skip generating an installer package.")
|
||||
.SetHidden(true);
|
||||
|
||||
this.AreMutuallyExclusive(NoPortableOption, NoInstOption);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user