Add executable permission in CopyFileOut

This commit is contained in:
Cheng Zhao 2015-11-27 22:06:37 +08:00
parent 6ef6a83042
commit cfdcfcbd80
4 changed files with 9 additions and 15 deletions

View file

@ -1,6 +1,5 @@
asar = process.binding 'atom_common_asar'
child_process = require 'child_process'
fs = require 'fs'
path = require 'path'
util = require 'util'
@ -84,11 +83,6 @@ overrideAPISync = (module, name, arg = 0) ->
newPath = archive.copyFileOut filePath
notFoundError asarPath, filePath unless newPath
stat = archive.stat filePath
if stat.executable
fs.chmodSync(newPath, 0o755)
arguments[arg] = newPath
old.apply this, arguments
@ -108,11 +102,6 @@ overrideAPI = (module, name, arg = 0) ->
newPath = archive.copyFileOut filePath
return notFoundError asarPath, filePath, callback unless newPath
stat = archive.stat filePath
if stat.executable
fs.chmodSync(newPath, 0o755)
arguments[arg] = newPath
old.apply this, arguments