@umijs/utils 4.6.63 → 4.6.64

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.
@@ -37,6 +37,10 @@ var import_path = require("path");
37
37
  var import_fs_extra = __toESM(require("../../compiled/fs-extra"));
38
38
  var import_Generator = __toESM(require("../Generator/Generator"));
39
39
  var BaseGenerator = class extends import_Generator.default {
40
+ path;
41
+ target;
42
+ data;
43
+ questions;
40
44
  constructor({
41
45
  path,
42
46
  target,
@@ -40,6 +40,10 @@ var import_glob = __toESM(require("../../compiled/glob"));
40
40
  var import_mustache = __toESM(require("../../compiled/mustache"));
41
41
  var import_prompts = __toESM(require("../../compiled/prompts"));
42
42
  var Generator = class {
43
+ baseDir;
44
+ args;
45
+ slient;
46
+ prompts;
43
47
  constructor({ baseDir, args, slient }) {
44
48
  this.baseDir = baseDir;
45
49
  this.args = args;
@@ -79,8 +83,7 @@ var Generator = class {
79
83
  });
80
84
  files.forEach((file) => {
81
85
  const absFile = (0, import_path.join)(opts.path, file);
82
- if ((0, import_fs.statSync)(absFile).isDirectory())
83
- return;
86
+ if ((0, import_fs.statSync)(absFile).isDirectory()) return;
84
87
  if (file.endsWith(".tpl")) {
85
88
  this.copyTpl({
86
89
  templatePath: absFile,
@@ -66,11 +66,18 @@ var getFileCreateInfo = async (filePath, gitDirPath) => {
66
66
  const info = await promisifySpawn(
67
67
  "git",
68
68
  // time|name|email|since
69
- ["log", "--reverse", "-1000000", "--pretty='%ad|%an|%ae|%ar'", filePath],
69
+ [
70
+ "log",
71
+ "--reverse",
72
+ "-1000000",
73
+ "--pretty=%ad|%an|%ae|%ar",
74
+ "--",
75
+ filePath
76
+ ],
70
77
  {
71
78
  cwd: gitDirPath,
72
79
  onlyOnce: true,
73
- shell: true
80
+ shell: false
74
81
  }
75
82
  );
76
83
  if (info.length && info[0]) {
@@ -92,11 +99,11 @@ var getFileLastModifyInfo = async (filePath, gitDirPath) => {
92
99
  try {
93
100
  const info = await promisifySpawn(
94
101
  "git",
95
- ["log", "-1", "--pretty='%ad|%an|%ae|%ar'", filePath],
102
+ ["log", "-1", "--pretty=%ad|%an|%ae|%ar", "--", filePath],
96
103
  {
97
104
  cwd: gitDirPath,
98
105
  onlyOnce: true,
99
- shell: true
106
+ shell: false
100
107
  }
101
108
  );
102
109
  if (info.length && info[0]) {
package/dist/tryPaths.js CHANGED
@@ -25,8 +25,7 @@ module.exports = __toCommonJS(tryPaths_exports);
25
25
  var import_fs = require("fs");
26
26
  function tryPaths(paths) {
27
27
  for (const path of paths) {
28
- if ((0, import_fs.existsSync)(path))
29
- return path;
28
+ if ((0, import_fs.existsSync)(path)) return path;
30
29
  }
31
30
  }
32
31
  // Annotate the CommonJS export names for ESM import in node:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/utils",
3
- "version": "4.6.63",
3
+ "version": "4.6.64",
4
4
  "homepage": "https://github.com/umijs/umi/tree/master/packages/utils#readme",
5
5
  "bugs": "https://github.com/umijs/umi/issues",
6
6
  "repository": {