zcatalyst-cli 1.17.0 → 1.17.1
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.
|
@@ -17,9 +17,9 @@ const semver_1 = require("semver");
|
|
|
17
17
|
const error_1 = __importDefault(require("../../error"));
|
|
18
18
|
const runtime_store_1 = __importDefault(require("../../runtime-store"));
|
|
19
19
|
const userConfig_1 = __importDefault(require("../../userConfig"));
|
|
20
|
-
const env_1 = require("../../util_modules/env");
|
|
21
20
|
const shell_1 = require("../../util_modules/shell");
|
|
22
21
|
const java_1 = require("./java");
|
|
22
|
+
const path_1 = require("path");
|
|
23
23
|
exports.stackVsVersions = {
|
|
24
24
|
java8: {
|
|
25
25
|
version: '1.8.0',
|
|
@@ -140,12 +140,6 @@ function getJavaSpawnCommand(spawnCommand, process, stack) {
|
|
|
140
140
|
if (isUsingJavaDefaultPath === true) {
|
|
141
141
|
return process;
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
spawnCommand = `"${spawnCommand}\\${process}"`;
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
spawnCommand = `${spawnCommand}/${process}`;
|
|
148
|
-
}
|
|
149
|
-
return spawnCommand;
|
|
143
|
+
return (0, path_1.join)(spawnCommand, process);
|
|
150
144
|
}
|
|
151
145
|
exports.getJavaSpawnCommand = getJavaSpawnCommand;
|
package/lib/fn-utils/lib/java.js
CHANGED
|
@@ -239,10 +239,11 @@ function compileTarget(target) {
|
|
|
239
239
|
yield Promise.all(entries.map((file) => compileJavaFiles(file, spawnCommand, targetVersion, targetSource, outputFolder)
|
|
240
240
|
.then((result) => {
|
|
241
241
|
const [_stdout, stderr, code] = result;
|
|
242
|
-
if (code === 1) {
|
|
242
|
+
if (code === null || code >= 1) {
|
|
243
243
|
const error = [];
|
|
244
244
|
error === null || error === void 0 ? void 0 : error.push(stderr);
|
|
245
245
|
target.valid = false;
|
|
246
|
+
target.failure_reason = 'there was a Java compilation error';
|
|
246
247
|
target.compilationError = error;
|
|
247
248
|
}
|
|
248
249
|
else if (stderr) {
|
|
@@ -250,6 +251,7 @@ function compileTarget(target) {
|
|
|
250
251
|
}
|
|
251
252
|
})
|
|
252
253
|
.catch((error) => {
|
|
254
|
+
target.valid = false;
|
|
253
255
|
target.failure_reason = error.message;
|
|
254
256
|
})));
|
|
255
257
|
const currentCommand = (0, option_1.getCurrentCommand)();
|
|
@@ -439,10 +441,7 @@ function validate(targets, idx) {
|
|
|
439
441
|
skipHelp: !!(0, option_1.getOptionValue)('watch', false)
|
|
440
442
|
});
|
|
441
443
|
});
|
|
442
|
-
|
|
443
|
-
currentTarget.valid = true;
|
|
444
|
-
return validate(targets, ++idx);
|
|
445
|
-
}
|
|
444
|
+
return validate(targets, ++idx);
|
|
446
445
|
}
|
|
447
446
|
catch (err) {
|
|
448
447
|
currentTarget.valid = false;
|
package/lib/fn-watcher.js
CHANGED
|
@@ -40,16 +40,13 @@ exports.default = (target) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
40
40
|
watcher.emit('preparing');
|
|
41
41
|
target.failure_reason = undefined;
|
|
42
42
|
target.valid = true;
|
|
43
|
+
target.compilationError = undefined;
|
|
44
|
+
target.compilationWarning = undefined;
|
|
43
45
|
yield fs_1.ASYNC.chmod((0, path_1.join)(runtime_store_1.default.get('project.root'), constants_1.FOLDERNAME.build, constants_1.FOLDERNAME.functions, target.name), '755', { recursive: true });
|
|
44
46
|
yield (0, languages_1.prepareFunctions)([target], latestEvent);
|
|
45
47
|
if (currentLatestEvent.at === latestEvent.at) {
|
|
46
48
|
latestEvent = undefined;
|
|
47
49
|
}
|
|
48
|
-
if (target.valid) {
|
|
49
|
-
watcher.emit('compiled');
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
(0, logger_1.warning)('target [' + target.name + '] is not a valid one reason : ' + target.failure_reason);
|
|
53
50
|
if (target.compilationError) {
|
|
54
51
|
target.compilationError.forEach((error) => {
|
|
55
52
|
console.log(`${(0, ansi_colors_1.red)(char_1.CHAR.error)} Error while compiling function[${target.name}]`);
|
|
@@ -62,6 +59,11 @@ exports.default = (target) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
62
59
|
console.warn(warn);
|
|
63
60
|
});
|
|
64
61
|
}
|
|
62
|
+
if (target.valid) {
|
|
63
|
+
watcher.emit('compiled');
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
(0, logger_1.warning)('target [' + target.name + '] is not a valid one reason : ' + target.failure_reason);
|
|
65
67
|
(0, logger_1.info)('Waiting for correction..');
|
|
66
68
|
(0, logger_1.info)('\n(To exit, press ^C)');
|
|
67
69
|
watcher.emit('next');
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ public class {{_CLASS_}} implements CatalystAdvancedIOHandler {
|
|
|
14
14
|
try {
|
|
15
15
|
switch(request.getRequestURI()) {
|
|
16
16
|
case "/": {
|
|
17
|
-
String name =
|
|
17
|
+
String name = request.getParameter("name");
|
|
18
18
|
LOGGER.log(Level.INFO, "Hello "+name);
|
|
19
19
|
response.setStatus(200);
|
|
20
20
|
response.getWriter().write("Hello from {{_CLASS_}}.java");
|