@kinkai.cloud/vibecheck 0.1.2 → 0.1.3
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/cli.js +8 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -14918,6 +14918,9 @@ async function abrirBrowser(url2) {
|
|
|
14918
14918
|
if (await tentarSpawn(cmd, args)) return;
|
|
14919
14919
|
}
|
|
14920
14920
|
}
|
|
14921
|
+
function deveAbrirNavegador(opts) {
|
|
14922
|
+
return !opts.ci && !opts.noWait;
|
|
14923
|
+
}
|
|
14921
14924
|
async function detalheHttp(resposta) {
|
|
14922
14925
|
const tipo = resposta.headers.get("content-type") ?? "";
|
|
14923
14926
|
if (tipo.includes("application/json")) {
|
|
@@ -15102,6 +15105,7 @@ async function acompanhar(liveUrl, scanId, shareToken) {
|
|
|
15102
15105
|
}
|
|
15103
15106
|
async function main(argv) {
|
|
15104
15107
|
const ci = temFlag("--ci", argv) || process.env["CI"] === "true" || process.env["VIBECHECK_TOKEN"] !== void 0 && process.env["VIBECHECK_TOKEN"].length > 0;
|
|
15108
|
+
const noWait = temFlag("--no-wait", argv);
|
|
15105
15109
|
const raiz = arg("--dir", argv) ?? process.cwd();
|
|
15106
15110
|
let url2 = arg("--url", argv) ?? argv.find((a) => a.startsWith("http")) ?? null;
|
|
15107
15111
|
let cred = lerToken();
|
|
@@ -15142,6 +15146,9 @@ async function main(argv) {
|
|
|
15142
15146
|
console.error(corpo.error ?? "n\xE3o foi poss\xEDvel abrir o scan");
|
|
15143
15147
|
return 1;
|
|
15144
15148
|
}
|
|
15149
|
+
const live = corpo.liveUrl ?? `${base}/avancado/${corpo.scanId}`;
|
|
15150
|
+
console.warn(live);
|
|
15151
|
+
if (deveAbrirNavegador({ ci, noWait })) await abrirBrowser(live);
|
|
15145
15152
|
if (avancado && grafo !== null) {
|
|
15146
15153
|
const put = await fetch(`${base}/api/cli/scan/${corpo.scanId}/graph`, {
|
|
15147
15154
|
method: "PUT",
|
|
@@ -15150,9 +15157,7 @@ async function main(argv) {
|
|
|
15150
15157
|
});
|
|
15151
15158
|
if (!put.ok) console.warn("grafo rejeitado pelo servidor \u2014 scan segue s\xF3 HTTP");
|
|
15152
15159
|
}
|
|
15153
|
-
|
|
15154
|
-
console.warn(live);
|
|
15155
|
-
if (temFlag("--no-wait", argv)) return 0;
|
|
15160
|
+
if (noWait) return 0;
|
|
15156
15161
|
return acompanhar(live, corpo.scanId, corpo.shareToken ?? "");
|
|
15157
15162
|
}
|
|
15158
15163
|
var codigo = await main(process.argv.slice(2));
|