@zuplo/cli 1.17.0 → 1.18.0
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.
- package/dist/cmds/deploy.js +3 -1
- package/dist/cmds/test.js +3 -1
- package/dist/common/output.js +16 -0
- package/dist/deploy/handler.js +2 -2
- package/package.json +1 -1
package/dist/cmds/deploy.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import setBlocking from "../common/output.js";
|
|
1
2
|
import { validDeployDirectoryValidator } from "../common/validators/file-system-validator.js";
|
|
2
3
|
import { YargsChecker } from "../common/validators/lib.js";
|
|
3
4
|
import { deploy } from "../deploy/handler.js";
|
|
@@ -21,7 +22,8 @@ export default {
|
|
|
21
22
|
})
|
|
22
23
|
.check(async (argv) => {
|
|
23
24
|
return await new YargsChecker(validDeployDirectoryValidator).check(argv.dir);
|
|
24
|
-
})
|
|
25
|
+
})
|
|
26
|
+
.middleware([setBlocking]);
|
|
25
27
|
},
|
|
26
28
|
handler: async (argv) => {
|
|
27
29
|
await deploy(argv);
|
package/dist/cmds/test.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import setBlocking from "../common/output.js";
|
|
1
2
|
import { validTestDirectoryValidator } from "../common/validators/file-system-validator.js";
|
|
2
3
|
import { YargsChecker } from "../common/validators/lib.js";
|
|
3
4
|
import { test } from "../test/handler.js";
|
|
@@ -19,7 +20,8 @@ export default {
|
|
|
19
20
|
})
|
|
20
21
|
.check(async (argv) => {
|
|
21
22
|
return await new YargsChecker(validTestDirectoryValidator).check(argv.dir);
|
|
22
|
-
})
|
|
23
|
+
})
|
|
24
|
+
.middleware([setBlocking]);
|
|
23
25
|
},
|
|
24
26
|
handler: async (argv) => {
|
|
25
27
|
await test(argv);
|
package/dist/common/output.js
CHANGED
|
@@ -9,4 +9,20 @@ export function printCriticalFailureToConsoleAndExit(message) {
|
|
|
9
9
|
export function printResultToConsole(message) {
|
|
10
10
|
console.log(chalk.bold.green(message));
|
|
11
11
|
}
|
|
12
|
+
export function printResultToConsoleAndExitGracefully(message) {
|
|
13
|
+
printResultToConsole(message);
|
|
14
|
+
process.exit(0);
|
|
15
|
+
}
|
|
16
|
+
export default function setBlocking() {
|
|
17
|
+
if (typeof process === "undefined")
|
|
18
|
+
return;
|
|
19
|
+
[process.stdout, process.stderr].forEach((_stream) => {
|
|
20
|
+
const stream = _stream;
|
|
21
|
+
if (stream._handle &&
|
|
22
|
+
stream.isTTY &&
|
|
23
|
+
typeof stream._handle.setBlocking === "function") {
|
|
24
|
+
stream._handle.setBlocking(true);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
12
28
|
//# sourceMappingURL=output.js.map
|
package/dist/deploy/handler.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parse } from "path";
|
|
2
2
|
import { logger } from "../common/logger.js";
|
|
3
|
-
import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole,
|
|
3
|
+
import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, } from "../common/output.js";
|
|
4
4
|
import settings from "../common/settings.js";
|
|
5
5
|
import { archive, ARCHIVE_EXTENSION } from "./archive.js";
|
|
6
6
|
import { upload } from "./file-upload.js";
|
|
@@ -30,7 +30,7 @@ export async function deploy(argv) {
|
|
|
30
30
|
const fileId = parse(new URL(uploadUrl).pathname).base.replace(ARCHIVE_EXTENSION, "");
|
|
31
31
|
const { url } = await pollDeployment(argv, fileId, account, project);
|
|
32
32
|
if (url) {
|
|
33
|
-
|
|
33
|
+
printResultToConsoleAndExitGracefully(`Deployed to ${url}`);
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
36
|
printCriticalFailureToConsoleAndExit(`Failed to deploy the current branch ${archiveMetadata.metadata.branch} to project ${project} on account ${account}.`);
|