Skip to content

Commit

Permalink
fix(node): no-dir when globbing
Browse files Browse the repository at this point in the history
  • Loading branch information
kirinnee committed Nov 14, 2023
1 parent 7925795 commit 27a15bd
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions sdks/node/src/domain/core/fs/cyan_fs_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class CyanFileHelper {
cwd: globRoot,
ignore: g.exclude,
dot: true,
nodir: true,
});

return matched.map(
Expand All @@ -64,7 +65,12 @@ export class CyanFileHelper {
const globRoot = this.globDir(g);

return glob
.globSync(g.glob, { cwd: globRoot, ignore: g.exclude, dot: true })
.globSync(g.glob, {
cwd: globRoot,
ignore: g.exclude,
dot: true,
nodir: true,
})
.map((x) => new VirtualFileReference(globRoot, this.writeDir, x));
}

Expand All @@ -76,7 +82,12 @@ export class CyanFileHelper {
const globRoot = this.globDir(copy);

const files = glob
.globSync(copy.glob, { cwd: globRoot, ignore: copy.exclude, dot: true })
.globSync(copy.glob, {
cwd: globRoot,
ignore: copy.exclude,
dot: true,
nodir: true,
})
.map((x) => [path.join(globRoot, x), path.join(this.writeDir, x)]);

for (const [read, write] of files) {
Expand Down

0 comments on commit 27a15bd

Please sign in to comment.