mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
fs.traversePath(path) works if path is a symlink
This commit is contained in:
parent
c43c82fbcb
commit
de03cc82ed
@ -104,7 +104,7 @@ bool Native::Execute(const CefString& name,
|
||||
strcpy(rootPath, argument.c_str());
|
||||
char * const paths[] = {rootPath, NULL};
|
||||
|
||||
FTS *tree = fts_open(paths, FTS_PHYSICAL| FTS_NOCHDIR | FTS_NOSTAT, NULL);
|
||||
FTS *tree = fts_open(paths, FTS_COMFOLLOW | FTS_PHYSICAL| FTS_NOCHDIR | FTS_NOSTAT, NULL);
|
||||
if (tree == NULL) {
|
||||
return true;
|
||||
}
|
||||
|
1
spec/fixtures/symlink-to-dir
vendored
Symbolic link
1
spec/fixtures/symlink-to-dir
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
dir
|
@ -90,6 +90,18 @@ describe "fs", ->
|
||||
for path in paths
|
||||
expect(path).not.toMatch /\/dir\//
|
||||
|
||||
it "returns entries if path is a symlink", ->
|
||||
symlinkPaths = []
|
||||
onSymlinkPath = (path) -> symlinkPaths.push(path)
|
||||
|
||||
paths = []
|
||||
onPath = (path) -> paths.push(path)
|
||||
|
||||
fs.traverseTree(fs.join(fixturesDir, 'symlink-to-dir'), onSymlinkPath, onSymlinkPath)
|
||||
fs.traverseTree(fs.join(fixturesDir, 'dir'), onPath, onPath)
|
||||
|
||||
expect(symlinkPaths).toEqual(paths)
|
||||
|
||||
describe ".lastModified(path)", ->
|
||||
it "returns a Date object representing the time the file was last modified", ->
|
||||
beforeWrite = new Date
|
||||
|
Loading…
Reference in New Issue
Block a user