Skip to content

Commit

Permalink
refactor: ls for cp_r
Browse files Browse the repository at this point in the history
  • Loading branch information
afeiship committed Aug 9, 2023
1 parent 0d649d8 commit ae51867
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/lib/cp_r.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fs from 'fs';
import fg from 'fast-glob';
import path from 'path';
import mkdir_p from './mkdir_p';
import rm_rf from './rm_rf';
import ls from './ls';

type CpROptions = {
forceClean?: boolean;
Expand All @@ -22,11 +22,7 @@ const cp_r = (src: string, dest: string, options?: CpROptions) => {
}

if (stat.isDirectory()) {
const files = fg.sync(['**/*'], {
cwd: src,
dot: true,
onlyFiles: true,
});
const files = ls(src);

files.forEach((file) => {
const srcFile = path.join(src, file);
Expand Down

0 comments on commit ae51867

Please sign in to comment.