nexe: fs.readdir returns file 'dist' with 3.0.0-beta.11
Is this a BUG or a FEATURE REQUEST?: BUG
What happened:
When running fs.readdir for a certain directory path, let’s say /example/dir, if I run the nexe application from under that same directory path, let’s say /example/dir/testNexe, fs.readdir will return a dist file that does not exist. This is the path returned by fs.readdir:
/example/dir/testNexe/dist
What you expected to happen:
fs.readdir should not return a file that does not exist when running the nexe app from a directory under the one passed to fs.readdir
How to reproduce it (as minimally and precisely as possible):
- Call
fs.readdirwith a path (i.e./example/dir) in a packaged nexe application - Log result returned from
fs.readdir - Run the nexe application from a directory under
/example/dir(i.e./example/dir/testNexe) /example/dir/testNexe/distis logged and should not.
Anything else we need to know?:
- This doesn’t happen when running the nexe application from a directory not under the directory passed to
fs.readdir - This doesn’t happen with nexe
2.0.0-rc.34 - This is happening on both OSX Mojave and Debian 7.
Environment
- Platform(OS/Version): OSX Mojave, Debian 7
- Host Node Version: 8
- Target Node Version: 8
- Nexe version: 3.0.0-beta.11
- Python Version: 2.7.10
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 2
- Comments: 15 (9 by maintainers)
fs.promises.readdirworks!I tried with 3.0.5 and it produced the same results btw.
The problem come from nexe build command.
If I use the following
nexe dist/bundle.js -t linux-x86 -o out/main. The following error is going to happen when doingfs.readdir("/root"):UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, lstat '/root/dist'If I use the following
nexe bundle.js -t linux-x86 -o out/main. The following error is going to happen when doingfs.readdir("/root"):UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, lstat '/root/bundle.js'