utiller 1.0.392 → 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
|
|
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
|
-
|
|
71
|
-
|
|
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
|
-
|
|
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
|
|
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("
|
|
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