mm_machine 1.5.3 → 1.5.5
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/index.js +20 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -184,13 +184,32 @@ Item.prototype.loadFile = function(file) {
|
|
|
184
184
|
return obj;
|
|
185
185
|
};
|
|
186
186
|
|
|
187
|
+
function rmdir(dir) {
|
|
188
|
+
var list = fs.readdirSync(dir);
|
|
189
|
+
for (var i = 0; i < list.length; i++) {
|
|
190
|
+
var filename = path.join(dir, list[i]);
|
|
191
|
+
var stat = fs.statSync(filename);
|
|
192
|
+
|
|
193
|
+
if (filename == "." || filename == "..") {
|
|
194
|
+
// pass these files
|
|
195
|
+
} else if (stat.isDirectory()) {
|
|
196
|
+
// rmdir recursively
|
|
197
|
+
rmdir(filename);
|
|
198
|
+
} else {
|
|
199
|
+
// rm fiilename
|
|
200
|
+
fs.unlinkSync(filename);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
fs.rmdirSync(dir);
|
|
204
|
+
};
|
|
205
|
+
|
|
187
206
|
/**
|
|
188
207
|
* @description 删除脚本
|
|
189
208
|
*/
|
|
190
209
|
Item.prototype.del_script = function() {
|
|
191
210
|
var f = this.config.func_file;
|
|
192
211
|
if (f) {
|
|
193
|
-
|
|
212
|
+
rmdir(this.dir);
|
|
194
213
|
}
|
|
195
214
|
};
|
|
196
215
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_machine",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"description": "这是超级美眉框架机制构建辅助模块,用于快速构建一个机制",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/qiuwenwu/mm_machine#readme",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"mm_config": "^1.0.
|
|
32
|
+
"mm_config": "^1.0.3"
|
|
33
33
|
}
|
|
34
34
|
}
|