Merge pull request #14682 from atom/bring-back-asar

Bring back ASAR archives
This commit is contained in:
Antonio Scandurra
2017-08-15 10:43:29 +02:00
committed by GitHub
2 changed files with 18 additions and 1 deletions

View File

@@ -98,7 +98,7 @@ module.exports = function (packagedAppPath) {
console.log(`Copying icon into "${debianPackageIconsDirPath}"`)
fs.copySync(
path.join(packagedAppPath, 'resources', 'app', 'resources', 'atom.png'),
path.join(packagedAppPath, 'resources', 'app.asar.unpacked', 'resources', 'atom.png'),
path.join(debianPackageIconsDirPath, `${atomExecutableName}.png`)
)

View File

@@ -19,6 +19,7 @@ module.exports = function () {
'app-copyright': `Copyright © 2014-${(new Date()).getFullYear()} GitHub, Inc. All rights reserved.`,
'app-version': CONFIG.appMetadata.version,
'arch': process.platform === 'darwin' ? 'x64' : process.arch, // OS X is 64-bit only
'asar': {unpack: buildAsarUnpackGlobExpression()},
'build-version': CONFIG.appMetadata.version,
'download': {cache: CONFIG.electronDownloadPath},
'dir': CONFIG.intermediateAppPath,
@@ -95,6 +96,22 @@ function chmodNodeFiles (packagedAppPath) {
childProcess.execSync(`find "${packagedAppPath}" -type f -name *.node -exec chmod a-x {} \\;`)
}
function buildAsarUnpackGlobExpression () {
const unpack = [
'*.node',
'ctags-config',
'ctags-darwin',
'ctags-linux',
'ctags-win32.exe',
path.join('**', 'node_modules', 'spellchecker', '**'),
path.join('**', 'node_modules', 'dugite', 'git', '**'),
path.join('**', 'node_modules', 'github', 'bin', '**'),
path.join('**', 'resources', 'atom.png')
]
return `{${unpack.join(',')}}`
}
function getAppName () {
if (process.platform === 'darwin') {
return CONFIG.channel === 'beta' ? 'Atom Beta' : 'Atom'