Commit graph

76 commits

Author SHA1 Message Date
Jessica Lord
ab8908a4af Use const 2016-01-14 14:41:46 -08:00
Jessica Lord
1779701445 Use const 2016-01-14 14:40:12 -08:00
Kevin Sawicki
030d2a843c Remove extra newlines around comments 2016-01-14 11:10:12 -08:00
Kevin Sawicki
990dc30e8d Use // for multi-line comments 2016-01-14 10:44:21 -08:00
Kevin Sawicki
f4af744519 Use // for single line comments 2016-01-14 10:35:29 -08:00
Kevin Sawicki
b547a38b3f Add wrapper functions to mirror old CoffeeScript 2016-01-12 16:24:06 -08:00
Kevin Sawicki
1f9691ae13 Convert all source files to JavaScript 2016-01-12 16:24:06 -08:00
Kevin Sawicki
403870a27e Migrate to block comments 2016-01-12 16:22:34 -08:00
Cheng Zhao
c4071a7f66 Throw ENOTDIR when calling mkdir inside asar archive 2016-01-06 12:04:16 +08:00
Cheng Zhao
e3ec1fe8ab Add process.noAsar to turn off asar support 2015-12-01 13:09:37 +08:00
Cheng Zhao
cfdcfcbd80 Add executable permission in CopyFileOut 2015-11-27 22:06:37 +08:00
Juan Cruz Viotti
585ff9062c 🐛 Fix missing execution permission bit in execFile override
Consider an electron application that uses `execFile` to run a script
that lives within the application code base:

```coffee
child_process = require 'child_process'
child_process.execFile __dirname + '/script.sh', (error) ->
  throw error if error?
```

An application like this will fail when being packaged in an `asar` with
an following error:

```
Error: spawn EACCES
```

Electron overrides certain `fs` functions to make them work within an
`asar` package. In the case of `execFile`, the file to be executed is
extracted from the `asar` package into a temporary file and ran from
there.

The problem is that during the extraction, the original permissions of
the file are lost.

We workaround this by:

1. Extending `asar.stat` to return whether a file is executable or not,
  which is information that's already saved in the `asar` header.

2. Setting execution permissions on the extracted file if the above
  property holds true.

Fixes: https://github.com/atom/electron/issues/3512
2015-11-26 23:30:23 -04:00
Cheng Zhao
784d2633a9 Make child_process.execFileSync support asar 2015-11-20 10:33:57 +08:00
Cheng Zhao
c649c4cf4f Rename the env to ELECTRON_HIDE_INTERNAL_MODULES 2015-11-12 21:37:44 +08:00
Cheng Zhao
f9d7e7ce55 Add ELECTRON_DISABLE_OLD_STYLE_MODULES env 2015-11-12 17:02:04 +08:00
Antonio Scandurra
9c69877421 Allow v8 to optimize fs.readFileSync 2015-10-30 10:30:27 +01:00
Prince J Wesley
810af2f95d 🐛 Honor fs.readFileSync contract for empty packed asar file 2015-10-19 08:43:50 +05:30
Cheng Zhao
01d2765e4b Prevent Node from adding paths outside this app to search paths 2015-10-03 20:38:39 +08:00
Cheng Zhao
9fe326ebeb Clear node's global search paths 2015-10-03 19:55:59 +08:00
Cheng Zhao
42515c6f41 No more need of manually setting process as local variable 2015-09-22 14:30:54 +08:00
Cheng Zhao
eccb5e7590 Don't make setImmediate a local variable
It makes more troubles than benefits, and somehow it is slowing message
loop down.
2015-09-22 14:29:21 +08:00
Indrek Ardel
c626ee6e92 Fix a typo 2015-09-19 21:17:23 +03:00
Cheng Zhao
9d366e6c5c Make global.setImmediate work in browser process 2015-09-14 16:34:58 +08:00
Cheng Zhao
d2e52fb6bb Set global.setImmediate 2015-09-14 16:25:43 +08:00
Cheng Zhao
3bd16a5ecd No more need to override setImmediate
It is now done in Node.js.
2015-09-14 15:47:39 +08:00
Rich Hong
f51103f44a Update internalModuleReadFile to support unpacked asar files
Add tests for reading unpacked files using both fs.readFileSync and
internalModuleReadFile
2015-06-22 19:38:47 -04:00
Cheng Zhao
db8ffe1dc7 Handle ".." in asar path, fix #1982 2015-06-17 15:52:49 +08:00
Cheng Zhao
605722c397 Make asar work with internalModuleReadFile and internalModuleStat 2015-06-10 16:18:55 +08:00
Kirk Ouimet
75448ad7ed Guarding against polluted Object.prototypes 2015-06-07 23:59:49 -07:00
Cheng Zhao
0e7bc6b8ec Make "original-fs" available as built-in module 2015-05-20 13:29:05 +08:00
Cheng Zhao
d9c769fa69 Reuse archive's fd in Node asar API 2015-05-11 11:10:50 +08:00
deepak1556
da648511b3 asar: make fs async methods create errors asynchronously 2015-04-25 10:08:02 +05:30
Cheng Zhao
500d15f53a Also remove user-defined search paths in renderer 2015-04-23 13:17:18 +08:00
Cheng Zhao
1479f73612 Simplify #1261 2015-03-21 19:20:52 +08:00
Cheng Zhao
5e8c478b2c Merge pull request #1261 from deepak1556/asar_lib_patch
fs.read empty files from asar archive
2015-03-21 19:17:49 +08:00
deepak1556
fdc10e4e5f Allow reading empty file from asar archive 2015-03-21 14:56:03 +05:30
Cheng Zhao
b5a8cfb704 Recognize asar archive with unpacked files 2015-03-20 20:34:58 +08:00
Cheng Zhao
1df033dce8 No need to override child_process.fork
We already support asar in Node mode.
2015-03-20 19:04:11 +08:00
Cheng Zhao
0b8efc434d Use __dirname when setting globalPaths 2015-02-13 12:55:06 +08:00
Cheng Zhao
45e2dd2ab5 Init asar support without external .js files 2015-02-04 10:45:17 -08:00
Cheng Zhao
6e469df90e Fix string escaping 2015-02-02 13:35:32 -08:00
Cheng Zhao
0c0a6bd939 Don't touch global fs object in graceful-fs 2015-02-02 13:35:32 -08:00
Cheng Zhao
afd6f41e08 Redirect process.binding('natives').fs to global fs object 2015-02-02 13:35:32 -08:00
Cheng Zhao
0a393eaa1c Enable wrap arbitrary fs object 2015-02-02 13:35:32 -08:00
Cheng Zhao
69092eee15 No need to preheat original-fs module 2015-01-19 15:47:21 -08:00
Cheng Zhao
5cb97545fd Add original-fs module 2014-11-12 11:09:59 +08:00
Cheng Zhao
48d54e8d3a Fix JavaScript errors in webview 2014-11-03 22:18:03 +08:00
Subash Pathak
9f8a5a7af3 Optimize fs.stat 2014-10-02 23:35:37 +05:45
Subash Pathak
dde8e47add Time Shim 2014-10-01 22:24:51 +05:45
Subash Pathak
0040f07097 Added Stat Time 2014-10-01 22:01:57 +05:45