utiller 1.0.390 → 1.0.393

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.
@@ -58,44 +58,27 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
58
58
  return reg.test(item.fileNameExtension);
59
59
  }].concat(exclude));
60
60
  });
61
- // 💡 調整函式簽名以接收可選的執行路徑 (path/cwd)
62
61
  (0, _defineProperty2["default"])(_this, "executeCommandLine", /*#__PURE__*/function () {
63
62
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(command) {
64
- var executionPath,
65
- self,
66
- _args = arguments;
63
+ var self;
67
64
  return _regenerator["default"].wrap(function _callee$(_context) {
68
65
  while (1) switch (_context.prev = _context.next) {
69
66
  case 0:
70
- executionPath = _args.length > 1 && _args[1] !== undefined ? _args[1] : process.cwd();
71
- self = _this; // 輸出時顯示執行的目錄,增加可讀性
72
- _this.appendInfo("\u57F7\u884C\u8173\u672C: ".concat(command));
73
- _this.appendInfo("\u57F7\u884C\u8DEF\u5F91: ".concat(executionPath));
67
+ self = _this;
68
+ _this.appendInfo("\u57F7\u884C\u8173\u672C ".concat(command));
74
69
  return _context.abrupt("return", new Promise(function (resolve, reject) {
75
- // 核心改動:將執行路徑作為 options 物件的 cwd 屬性傳遞
76
- _child_process["default"].exec(command, {
77
- cwd: executionPath,
78
- shell: "/bin/bash"
79
- },
80
- // ⬅️ 新增的 options 物件,指定 cwd
81
- function (error, stdout, stderr) {
70
+ _child_process["default"].exec(command, function (error, stdout, stderr) {
82
71
  self.appendInfo("".concat(stdout));
83
72
  self.appendInfo("".concat(stderr));
84
73
  if (error) {
85
74
  self.appendError("\u57F7\u884C\u932F\u8AA4: ".concat(error));
86
-
87
- // 🚨 重要的錯誤處理:將 stderr 包含在拒絕訊息中,便於除錯
88
- var fullError = new Error("Command failed: ".concat(error.message));
89
- fullError.code = error.code;
90
- fullError.stdout = stdout;
91
- fullError.stderr = stderr;
92
- reject(fullError);
75
+ reject(error);
93
76
  return;
94
77
  }
95
78
  resolve(stdout.trim());
96
79
  });
97
80
  }));
98
- case 5:
81
+ case 3:
99
82
  case "end":
100
83
  return _context.stop();
101
84
  }
@@ -1146,7 +1129,7 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
1146
1129
  release = _this7.persistByPath(_path4["default"].join(path, "release"));
1147
1130
  /** 利用babel 產生出 es5相容性高的src file */
1148
1131
  _context13.next = 8;
1149
- return _this7.executeCommandLine("npm run build:temp", path);
1132
+ return _this7.executeCommandLine("cd ".concat(path, " && npx babel ./temp --out-dir ./release/lib --config-file ./babel.config.js"));
1150
1133
  case 8:
1151
1134
  pathOfPackageJson = _path4["default"].join(path, "package.json");
1152
1135
  _context13.prev = 9;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utiller",
3
- "version": "1.0.390",
3
+ "version": "1.0.393",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -10,7 +10,7 @@
10
10
  "updateConfigerer": "npm update configerer --save"
11
11
  },
12
12
  "engines": {
13
- "node": "18"
13
+ "node": "20"
14
14
  },
15
15
  "author": "davidtu<freshingmoon0725@gmail.com>",
16
16
  "license": "ISC",
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "configerer": "^1.0.23",
14
- "utiller": "^1.0.389",
14
+ "utiller": "^1.0.392",
15
15
  "linepayer": "^1.0.15",
16
16
  "databazer": "^1.0.17",
17
17
  "lodash": "^4.17.20",