Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Fix osx command like arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Jul 6, 2022
1 parent 336919b commit 0fe9f8a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
28 changes: 15 additions & 13 deletions src/Squirrel.CommandLine/OSX/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ private static void Pack(PackOptions options)
if (options.mainExe != null)
Log.Warn("--exeName is ignored if the pack directory is a '.app' bundle.");

if (options.appleId != null)
Log.Warn("--appleId is ignored if the pack directory is a '.app' bundle.");
if (options.bundleId != null)
Log.Warn("--bundleId is ignored if the pack directory is a '.app' bundle.");

appBundlePath = Path.Combine(releaseDir.FullName, options.packId + ".app");

Expand Down Expand Up @@ -77,7 +77,7 @@ private static void Pack(PackOptions options)
CFBundleName = options.packTitle ?? options.packId,
CFBundleDisplayName = options.packTitle ?? options.packId,
CFBundleExecutable = options.mainExe,
CFBundleIdentifier = options.appleId ?? escapedAppleId,
CFBundleIdentifier = options.bundleId ?? escapedAppleId,
CFBundlePackageType = "APPL",
CFBundleShortVersionString = appleSafeVersion,
CFBundleVersion = options.packVersion,
Expand Down Expand Up @@ -177,18 +177,20 @@ private static void Pack(PackOptions options)
ReleaseEntry.WriteReleaseFile(releases, releaseFilePath);

// create installer package, sign and notarize
if (SquirrelRuntimeInfo.IsOSX) {
var pkgPath = Path.Combine(releaseDir.FullName, options.packId + ".pkg");
HelperExe.CreateInstallerPkg(appBundlePath, pkgTitle, options.pkgContent, pkgPath, options.signInstallIdentity);
if (!String.IsNullOrEmpty(options.signInstallIdentity) && !String.IsNullOrEmpty(options.notaryProfile)) {
HelperExe.Notarize(pkgPath, options.notaryProfile);
HelperExe.Staple(pkgPath);
if (!options.noPkg) {
if (SquirrelRuntimeInfo.IsOSX) {
var pkgPath = Path.Combine(releaseDir.FullName, options.packId + ".pkg");
HelperExe.CreateInstallerPkg(appBundlePath, pkgTitle, options.pkgContent, pkgPath, options.signInstallIdentity);
if (!String.IsNullOrEmpty(options.signInstallIdentity) && !String.IsNullOrEmpty(options.notaryProfile)) {
HelperExe.Notarize(pkgPath, options.notaryProfile);
HelperExe.Staple(pkgPath);
} else {
Log.Warn("Package installer (.pkg) will not be Notarized. " +
"This is supported with the --signInstallIdentity and --notaryProfile arguments.");
}
} else {
Log.Warn("Package installer (.pkg) will not be Notarized. " +
"This is supported with the --signInstallIdentity and --notaryProfile arguments.");
Log.Warn("Package installer (.pkg) will not be created - this is only supported on OSX.");
}
} else {
Log.Warn("Package installer (.pkg) will not be created - this is only supported on OSX.");
}

Log.Info("Done.");
Expand Down
7 changes: 4 additions & 3 deletions src/Squirrel.CommandLine/OSX/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ internal class PackOptions : BaseOptions
public string signInstallIdentity { get; private set; }
public string signEntitlements { get; private set; }
public string notaryProfile { get; private set; }
public string appleId { get; private set; }
public string bundleId { get; private set; }
public bool noPkg { get; private set; }
public KeyValuePair<string, string>[] pkgContent => _pkgContent.ToArray();

private Dictionary<string, string> _pkgContent = new Dictionary<string, string>();
Expand All @@ -41,9 +42,9 @@ public PackOptions()
Add("releaseNotes=", "{PATH} to file with markdown notes for version", v => releaseNotes = v);
Add("e=|mainExe=", "The file {NAME} of the main executable", v => mainExe = v);
Add("i=|icon=", "{PATH} to the .icns file for this bundle", v => icon = v);
Add("bundleId=", "Override the apple unique {ID} when generating bundles", v => bundleId = v);
Add("noDelta", "Skip the generation of delta packages", v => noDelta = true);
Add("appleId", "Override the apple bundle ID for generated bundles", v => appleId = v);
Add("noPkg", "Skip generating a .pkg installer", v => appleId = v);
Add("noPkg", "Skip generating a .pkg installer", v => noPkg = true);
Add("pkgContent=", "Add content files (eg. readme, license) to pkg installer.", (v1, v2) => _pkgContent.Add(v1, v2));

if (SquirrelRuntimeInfo.IsOSX) {
Expand Down

0 comments on commit 0fe9f8a

Please sign in to comment.