@zwa73/dev-utils 1.0.19 → 1.0.20

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.
@@ -25,7 +25,8 @@ const CmdScanDups = (program) => program
25
25
  .option("-r, --recursive", "是否处理子目录, 默认 true", true)
26
26
  .action(async (options) => {
27
27
  const regex = new RegExp(options.regex);
28
- const pList = utils_1.UtilFT.fileSearchRegex(__dirname.replaceAll("\\", "/"), regex.source, {
28
+ const basePath = process.cwd().replaceAll("\\", "/");
29
+ const pList = utils_1.UtilFT.fileSearchRegex(basePath, regex.source, {
29
30
  relative: options.recursive,
30
31
  normalize: "posix",
31
32
  }).map(async (filePath) => ({ filePath, hash: await calculateHash(filePath) }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/dev-utils",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "编译与调试工具",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,7 +23,8 @@ export const CmdScanDups = (program: Command) => program
23
23
  .option("-r, --recursive", "是否处理子目录, 默认 true", true)
24
24
  .action(async (options) => {
25
25
  const regex = new RegExp(options.regex);
26
- const pList = UtilFT.fileSearchRegex(__dirname.replaceAll("\\", "/"), regex.source, {
26
+ const basePath = process.cwd().replaceAll("\\", "/")
27
+ const pList = UtilFT.fileSearchRegex(basePath, regex.source, {
27
28
  relative: options.recursive,
28
29
  normalize: "posix",
29
30
  }).map(async (filePath) => ({ filePath, hash: await calculateHash(filePath) }));