]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
fix: the .git should be ignored when emptying the dir (#138)
authorbtea <2356281422@qq.com>
Thu, 11 Aug 2022 08:56:14 +0000 (16:56 +0800)
committerGitHub <noreply@github.com>
Thu, 11 Aug 2022 08:56:14 +0000 (16:56 +0800)
utils/directoryTraverse.ts

index d48d9f460dd4c2b2d02097a6b125204f16392497..4ec0e9424c5268a0ac41ea35f4f3dc43062ee130 100644 (file)
@@ -18,6 +18,9 @@ export function preOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
 
 export function postOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
   for (const filename of fs.readdirSync(dir)) {
+    if (filename === '.git') {
+      continue
+    }
     const fullpath = path.resolve(dir, filename)
     if (fs.lstatSync(fullpath).isDirectory()) {
       postOrderDirectoryTraverse(fullpath, dirCallback, fileCallback)