@zwa73/dev-utils 1.0.21 → 1.0.24
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/Command/MapPath.js
CHANGED
@@ -10,7 +10,8 @@ const path_1 = __importDefault(require("path"));
|
|
10
10
|
const DupMethodList = ["no-rename", "overwrite", "move"];
|
11
11
|
/**重命名文件或路径 */
|
12
12
|
const CmdMapPath = (program) => program
|
13
|
-
.command("
|
13
|
+
.command("Map-Path")
|
14
|
+
.alias("mappath")
|
14
15
|
.description("根据正则表达式对文件名进行映射")
|
15
16
|
.argument("<regex>", "要匹配的正则表达式, posix风格路径")
|
16
17
|
.argument("<replacement>", "替换字符串")
|
@@ -31,7 +31,7 @@ exports.MIRROR_SOURCE = "https://registry.npmmirror.com/";
|
|
31
31
|
/**npm官方源 */
|
32
32
|
exports.OFFICIAL_SOURCE = "https://registry.npmjs.org/";
|
33
33
|
/**data文件夹路径 */
|
34
|
-
exports.DATA_PATH = path.join(__dirname, '..', 'data');
|
34
|
+
exports.DATA_PATH = path.join(__dirname, '..', '..', 'data');
|
35
35
|
/**项目路径 */
|
36
36
|
exports.PROJECT_PATH = process.cwd();
|
37
37
|
/** 检测非浮点的整数类型 */
|
package/dist/Command/ScanDups.js
CHANGED
@@ -19,7 +19,8 @@ async function calculateHash(filePath) {
|
|
19
19
|
}
|
20
20
|
/**重命名文件或路径 scan_duplicates */
|
21
21
|
const CmdScanDups = (program) => program
|
22
|
-
.command("
|
22
|
+
.command("Scan-Dups")
|
23
|
+
.alias("scandups")
|
23
24
|
.description("扫描当前目录下hash重复的文件")
|
24
25
|
.option("-re, --regex <regex>", "文件的正则表达式, 使用posix路径", ".*")
|
25
26
|
.option("-o, --out <dir|console>", "输出的json文件路径, 默认 scandupsOut.json, 为 \"console\" 时无文件输出", "scandupsOut")
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zwa73/dev-utils",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.24",
|
4
4
|
"description": "编译与调试工具",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -15,7 +15,7 @@
|
|
15
15
|
"author": "zwa73",
|
16
16
|
"license": "ISC",
|
17
17
|
"dependencies": {
|
18
|
-
"@zwa73/utils": "^1.0.
|
18
|
+
"@zwa73/utils": "^1.0.111",
|
19
19
|
"commander": "^11.1.0",
|
20
20
|
"ts-node": "^10.9.2",
|
21
21
|
"tsconfig-paths": "^4.2.0",
|
package/src/Command/MapPath.ts
CHANGED
@@ -8,7 +8,8 @@ type DupMethod = typeof DupMethodList[number];
|
|
8
8
|
|
9
9
|
/**重命名文件或路径 */
|
10
10
|
export const CmdMapPath = (program: Command) => program
|
11
|
-
.command("
|
11
|
+
.command("Map-Path")
|
12
|
+
.alias("mappath")
|
12
13
|
.description("根据正则表达式对文件名进行映射")
|
13
14
|
.argument("<regex>", "要匹配的正则表达式, posix风格路径")
|
14
15
|
.argument("<replacement>", "替换字符串")
|
@@ -7,7 +7,7 @@ export const MIRROR_SOURCE = "https://registry.npmmirror.com/";
|
|
7
7
|
/**npm官方源 */
|
8
8
|
export const OFFICIAL_SOURCE = "https://registry.npmjs.org/";
|
9
9
|
/**data文件夹路径 */
|
10
|
-
export const DATA_PATH = path.join(__dirname,'..','data');
|
10
|
+
export const DATA_PATH = path.join(__dirname,'..','..','data');
|
11
11
|
/**项目路径 */
|
12
12
|
export const PROJECT_PATH = process.cwd();
|
13
13
|
|
package/src/Command/ScanDups.ts
CHANGED
@@ -17,7 +17,8 @@ async function calculateHash(filePath:string) {
|
|
17
17
|
|
18
18
|
/**重命名文件或路径 scan_duplicates */
|
19
19
|
export const CmdScanDups = (program: Command) => program
|
20
|
-
.command("
|
20
|
+
.command("Scan-Dups")
|
21
|
+
.alias("scandups")
|
21
22
|
.description("扫描当前目录下hash重复的文件")
|
22
23
|
.option("-re, --regex <regex>", "文件的正则表达式, 使用posix路径",".*")
|
23
24
|
.option("-o, --out <dir|console>", "输出的json文件路径, 默认 scandupsOut.json, 为 \"console\" 时无文件输出", "scandupsOut")
|