mdk-skills 2.1.9 → 2.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/core.js +7 -1
package/package.json
CHANGED
package/scripts/core.js
CHANGED
|
@@ -46,7 +46,13 @@ function backupDir(dir) {
|
|
|
46
46
|
|
|
47
47
|
for (const item of fs.readdirSync(dir)) {
|
|
48
48
|
if (item === "backups") continue;
|
|
49
|
-
|
|
49
|
+
const srcPath = path.join(dir, item);
|
|
50
|
+
const destPath = path.join(bakPath, item);
|
|
51
|
+
if (fs.statSync(srcPath).isDirectory()) {
|
|
52
|
+
copyDirSync(srcPath, destPath);
|
|
53
|
+
} else {
|
|
54
|
+
fs.copyFileSync(srcPath, destPath);
|
|
55
|
+
}
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
// 清理旧备份,只保留最近 3 份
|