Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function checkMacResult(packager: Packager, packagerOptions: PackagerOptions, checkOptions: AssertPackOptions, packedAppDir: string) {
const appInfo = packager.appInfo
const info = (await executeAppBuilderAsJson>(["decode-plist", "-f", path.join(packedAppDir, "Contents", "Info.plist")]))[0]
expect(info).toMatchObject({
CFBundleVersion: info.CFBundleVersion === "50" ? "50" : `${appInfo.version}.${(process.env.TRAVIS_BUILD_NUMBER || process.env.CIRCLE_BUILD_NUM)}`
})
// checked manually, remove to avoid mismatch on CI server (where TRAVIS_BUILD_NUMBER is defined and different on each test run)
delete info.AsarIntegrity
delete info.CFBundleVersion
delete info.BuildMachineOSBuild
delete info.NSHumanReadableCopyright
delete info.DTXcode
delete info.DTXcodeBuild
delete info.DTSDKBuild
delete info.DTSDKName
delete info.DTCompiler
delete info.ElectronTeamID
env.windowHeight = (window.height || 380).toString()
}
}
else {
delete env.backgroundColor
}
const args = ["dmg", "--volume", volumePath]
if (specification.icon != null) {
args.push("--icon", (await packager.getResource(specification.icon))!!)
}
if (backgroundFile != null) {
args.push("--background", backgroundFile)
}
const data: any = await executeAppBuilderAsJson(args)
if (data.backgroundWidth != null) {
env.windowWidth = window == null ? null : window.width
env.windowHeight = window == null ? null : window.height
if (env.windowWidth == null) {
env.windowWidth = data.backgroundWidth.toString()
}
if (env.windowHeight == null) {
env.windowHeight = data.backgroundHeight.toString()
}
if (env.windowX == null) {
env.windowX = 400
}
if (env.windowY == null) {
env.windowY = Math.round((1440 - env.windowHeight) / 2).toString()