Change permissions to node files on Linux

This commit is contained in:
Antonio Scandurra 2016-08-15 12:06:03 +02:00
parent 9e0d7638e4
commit fc95475d6e

View File

@ -42,6 +42,9 @@ module.exports = function () {
if (process.platform === 'darwin') {
bundledResourcesPath = path.join(packagedAppPath, 'Contents', 'Resources')
setAtomHelperVersion(packagedAppPath)
} else if (process.platform == 'linux') {
bundledResourcesPath = path.join(packagedAppPath, 'resources')
chmodNodeFiles(packagedAppPath)
} else {
bundledResourcesPath = path.join(packagedAppPath, 'resources')
}
@ -92,6 +95,11 @@ function setAtomHelperVersion (packagedAppPath) {
childProcess.spawnSync('/usr/libexec/PlistBuddy', ['-c', 'Set CFBundleShortVersionString', CONFIG.appMetadata.version, helperPListPath])
}
function chmodNodeFiles (packagedAppPath) {
console.log(`Changing permissions for node files in ${packagedAppPath}`)
childProcess.spawnSync('find', [packagedAppPath, '-type', 'f', '-name', '*.node', '-exec chmod a-x {};'])
}
function buildAsarUnpackGlobExpression () {
const unpack = [
'*.node',