@zwa73/dev-utils 1.0.20 → 1.0.21

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.
@@ -7,6 +7,7 @@ exports.CmdScanDups = void 0;
7
7
  const utils_1 = require("@zwa73/utils");
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const crypto_1 = __importDefault(require("crypto"));
10
+ const path_1 = __importDefault(require("path"));
10
11
  async function calculateHash(filePath) {
11
12
  return new Promise((resolve, reject) => {
12
13
  const hash = crypto_1.default.createHash('md5');
@@ -44,6 +45,6 @@ const CmdScanDups = (program) => program
44
45
  if (options.out === "console")
45
46
  utils_1.SLogger.info(out);
46
47
  else
47
- await utils_1.UtilFT.writeJSONFile(options.out, out);
48
+ await utils_1.UtilFT.writeJSONFile(path_1.default.join(basePath, options.out), out);
48
49
  });
49
50
  exports.CmdScanDups = CmdScanDups;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/dev-utils",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "编译与调试工具",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -2,6 +2,7 @@ import { SLogger, UtilFT } from "@zwa73/utils";
2
2
  import { Command } from "commander";
3
3
  import fs from "fs";
4
4
  import crypto from 'crypto';
5
+ import path from "path";
5
6
 
6
7
  async function calculateHash(filePath:string) {
7
8
  return new Promise<string>((resolve, reject) => {
@@ -42,5 +43,5 @@ export const CmdScanDups = (program: Command) => program
42
43
  if(options.out==="console")
43
44
  SLogger.info(out);
44
45
  else
45
- await UtilFT.writeJSONFile(options.out,out);
46
+ await UtilFT.writeJSONFile(path.join(basePath,options.out),out);
46
47
  });