mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Wrap binariesPromise handling in an if
Instead of forcing an immediate exit with process.exit(), wrap the handling of binariesPromise in an `if` statement, allowing the script to exit on its own if passed the new option.
This commit is contained in:
116
script/build
116
script/build
@@ -78,69 +78,67 @@ if (!argv.existingBinaries) {
|
||||
}
|
||||
}
|
||||
|
||||
if (argv.generateApiDocs) {
|
||||
process.exit()
|
||||
}
|
||||
|
||||
binariesPromise
|
||||
.then(packageApplication)
|
||||
.then(packagedAppPath => generateStartupSnapshot(packagedAppPath).then(() => packagedAppPath))
|
||||
.then(packagedAppPath => {
|
||||
switch (process.platform) {
|
||||
case 'darwin': {
|
||||
if (argv.codeSign) {
|
||||
codeSignOnMac(packagedAppPath)
|
||||
} else {
|
||||
console.log('Skipping code-signing. Specify the --code-sign option to perform code-signing'.gray)
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'win32': {
|
||||
if (argv.codeSign) {
|
||||
const executablesToSign = [ path.join(packagedAppPath, 'Atom.exe') ]
|
||||
if (argv.createWindowsInstaller) {
|
||||
executablesToSign.push(path.join(__dirname, 'node_modules', 'electron-winstaller', 'vendor', 'Update.exe'))
|
||||
if (!argv.generateApiDocs) {
|
||||
binariesPromise
|
||||
.then(packageApplication)
|
||||
.then(packagedAppPath => generateStartupSnapshot(packagedAppPath).then(() => packagedAppPath))
|
||||
.then(packagedAppPath => {
|
||||
switch (process.platform) {
|
||||
case 'darwin': {
|
||||
if (argv.codeSign) {
|
||||
codeSignOnMac(packagedAppPath)
|
||||
} else {
|
||||
console.log('Skipping code-signing. Specify the --code-sign option to perform code-signing'.gray)
|
||||
}
|
||||
codeSignOnWindows(executablesToSign)
|
||||
} else {
|
||||
console.log('Skipping code-signing. Specify the --code-sign option to perform code-signing'.gray)
|
||||
break
|
||||
}
|
||||
if (argv.createWindowsInstaller) {
|
||||
return createWindowsInstaller(packagedAppPath)
|
||||
.then(() => argv.codeSign && codeSignOnWindows([ path.join(CONFIG.buildOutputPath, 'AtomSetup.exe') ]))
|
||||
.then(() => packagedAppPath)
|
||||
} else {
|
||||
console.log('Skipping creating installer. Specify the --create-windows-installer option to create a Squirrel-based Windows installer.'.gray)
|
||||
case 'win32': {
|
||||
if (argv.codeSign) {
|
||||
const executablesToSign = [ path.join(packagedAppPath, 'Atom.exe') ]
|
||||
if (argv.createWindowsInstaller) {
|
||||
executablesToSign.push(path.join(__dirname, 'node_modules', 'electron-winstaller', 'vendor', 'Update.exe'))
|
||||
}
|
||||
codeSignOnWindows(executablesToSign)
|
||||
} else {
|
||||
console.log('Skipping code-signing. Specify the --code-sign option to perform code-signing'.gray)
|
||||
}
|
||||
if (argv.createWindowsInstaller) {
|
||||
return createWindowsInstaller(packagedAppPath)
|
||||
.then(() => argv.codeSign && codeSignOnWindows([ path.join(CONFIG.buildOutputPath, 'AtomSetup.exe') ]))
|
||||
.then(() => packagedAppPath)
|
||||
} else {
|
||||
console.log('Skipping creating installer. Specify the --create-windows-installer option to create a Squirrel-based Windows installer.'.gray)
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'linux': {
|
||||
if (argv.createDebianPackage) {
|
||||
createDebianPackage(packagedAppPath)
|
||||
} else {
|
||||
console.log('Skipping creating debian package. Specify the --create-debian-package option to create it.'.gray)
|
||||
}
|
||||
|
||||
if (argv.createRpmPackage) {
|
||||
createRpmPackage(packagedAppPath)
|
||||
} else {
|
||||
console.log('Skipping creating rpm package. Specify the --create-rpm-package option to create it.'.gray)
|
||||
}
|
||||
break
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'linux': {
|
||||
if (argv.createDebianPackage) {
|
||||
createDebianPackage(packagedAppPath)
|
||||
} else {
|
||||
console.log('Skipping creating debian package. Specify the --create-debian-package option to create it.'.gray)
|
||||
}
|
||||
|
||||
if (argv.createRpmPackage) {
|
||||
createRpmPackage(packagedAppPath)
|
||||
} else {
|
||||
console.log('Skipping creating rpm package. Specify the --create-rpm-package option to create it.'.gray)
|
||||
}
|
||||
break
|
||||
return Promise.resolve(packagedAppPath)
|
||||
}).then(packagedAppPath => {
|
||||
if (argv.compressArtifacts) {
|
||||
compressArtifacts(packagedAppPath)
|
||||
} else {
|
||||
console.log('Skipping artifacts compression. Specify the --compress-artifacts option to compress Atom binaries (and symbols on macOS)'.gray)
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.resolve(packagedAppPath)
|
||||
}).then(packagedAppPath => {
|
||||
if (argv.compressArtifacts) {
|
||||
compressArtifacts(packagedAppPath)
|
||||
} else {
|
||||
console.log('Skipping artifacts compression. Specify the --compress-artifacts option to compress Atom binaries (and symbols on macOS)'.gray)
|
||||
}
|
||||
|
||||
if (argv.install != null) {
|
||||
installApplication(packagedAppPath, argv.install)
|
||||
} else {
|
||||
console.log('Skipping installation. Specify the --install option to install Atom'.gray)
|
||||
}
|
||||
})
|
||||
if (argv.install != null) {
|
||||
installApplication(packagedAppPath, argv.install)
|
||||
} else {
|
||||
console.log('Skipping installation. Specify the --install option to install Atom'.gray)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user