@dcloudio/uni-cli-shared 3.0.0-alpha-3050020220623002 → 3.0.0-alpha-3050020220623003
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/dist/fs.d.ts +1 -1
- package/dist/fs.js +17 -2
- package/package.json +3 -3
package/dist/fs.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function emptyDir(dir: string): void;
|
|
1
|
+
export declare function emptyDir(dir: string, skip?: string[]): void;
|
package/dist/fs.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.emptyDir = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
4
5
|
const fs_extra_1 = require("fs-extra");
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
function emptyDir(dir, skip = []) {
|
|
8
|
+
for (const file of (0, fs_extra_1.readdirSync)(dir)) {
|
|
9
|
+
if (skip.includes(file)) {
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
const abs = (0, path_1.resolve)(dir, file);
|
|
13
|
+
// baseline is Node 12 so can't use rmSync :(
|
|
14
|
+
if ((0, fs_extra_1.lstatSync)(abs).isDirectory()) {
|
|
15
|
+
(0, fs_extra_1.emptyDirSync)(abs);
|
|
16
|
+
(0, fs_1.rmdirSync)(abs);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
(0, fs_extra_1.unlinkSync)(abs);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
7
22
|
}
|
|
8
23
|
exports.emptyDir = emptyDir;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-cli-shared",
|
|
3
|
-
"version": "3.0.0-alpha-
|
|
3
|
+
"version": "3.0.0-alpha-3050020220623003",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"@babel/core": "^7.17.9",
|
|
23
23
|
"@babel/parser": "^7.17.9",
|
|
24
24
|
"@babel/types": "^7.17.0",
|
|
25
|
-
"@dcloudio/uni-i18n": "3.0.0-alpha-
|
|
26
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
25
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-3050020220623003",
|
|
26
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3050020220623003",
|
|
27
27
|
"@intlify/core-base": "9.1.9",
|
|
28
28
|
"@intlify/shared": "9.1.9",
|
|
29
29
|
"@intlify/vue-devtools": "9.1.9",
|