sabia 2.0.0 → 2.0.2
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/package.json +1 -1
- package/sabia.mjs +7 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sabia",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Instala, atualiza e desinstala o Sabiá e os toolkits dele no Kiro e no opencode, com um inventário em ~/.sabia/, e explica a rota dos fluxos (sabia rota).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/sabia.mjs
CHANGED
|
@@ -362,7 +362,6 @@ function mostrarDiferencas(dif) {
|
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
export async function instalar(opcoes = {}) {
|
|
365
|
-
ctx.log(BANNER + "\n");
|
|
366
365
|
const inv = lerInventario();
|
|
367
366
|
const novo = baixarFramework(opcoes);
|
|
368
367
|
fs.rmSync(sabia("framework"), { recursive: true, force: true });
|
|
@@ -664,8 +663,10 @@ export function listarToolkits(opcoes = {}) {
|
|
|
664
663
|
l[0] = `↳ ${l[0]}`;
|
|
665
664
|
linhas.splice(i < 0 ? linhas.length : i + 1, 0, l);
|
|
666
665
|
}
|
|
667
|
-
|
|
668
|
-
|
|
666
|
+
// no terminal, a descrição é cortada na largura da tela; em pipe ou arquivo, sai inteira
|
|
667
|
+
const largura = process.stdout.columns;
|
|
668
|
+
const corta = (s) => { const c = [...s]; return !largura || c.length <= largura ? s : c.slice(0, largura - 1).join("") + "…"; };
|
|
669
|
+
ctx.log(colunas([["TOOLKIT", "AUTOR", "NO ÍNDICE", "INSTALADO", "NESTE PROJETO", "DESCRIÇÃO"], ...linhas]).split("\n").map(corta).join("\n"));
|
|
669
670
|
return linhas;
|
|
670
671
|
}
|
|
671
672
|
|
|
@@ -884,9 +885,7 @@ export function rotaMapa(opcoes = {}) {
|
|
|
884
885
|
|
|
885
886
|
// ---------- linha de comando ----------
|
|
886
887
|
|
|
887
|
-
const AJUDA =
|
|
888
|
-
|
|
889
|
-
sabia ${VERSAO} — instala o Sabiá e os toolkits no Kiro e no opencode
|
|
888
|
+
const AJUDA = `sabia ${VERSAO} — instala o Sabiá e os toolkits no Kiro e no opencode
|
|
890
889
|
|
|
891
890
|
sabia instalar [--alvo kiro,opencode] [--versao X] [--fonte <pasta|url-git>[@ref]]
|
|
892
891
|
sabia atualizar [--versao X] [--fonte <pasta|url-git>[@ref]]
|
|
@@ -930,6 +929,8 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
930
929
|
const antes = ctx.perguntar;
|
|
931
930
|
ctx.perguntar = async (texto, padrao) => (/alterado à mão/.test(texto) ? antes(texto, padrao) : /\[s\/N\]/.test(texto) ? "s" : padrao);
|
|
932
931
|
}
|
|
932
|
+
// o banner em todo comando, só no terminal: em pipe ou arquivo (o Mermaid do rota) a saída fica limpa
|
|
933
|
+
if (process.stdout.isTTY) ctx.log(BANNER + "\n");
|
|
933
934
|
try {
|
|
934
935
|
if (cmd === "instalar") await instalar(opcoes);
|
|
935
936
|
else if (cmd === "atualizar") await atualizar(opcoes);
|