@catladder/cli 0.0.0-next-a9386ffe → 0.0.0-next-a2f59d07
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/apps/cli/src/adapters/terminal.d.ts +8 -0
- package/dist/apps/cli/src/adapters/terminal.js +9 -2
- package/dist/apps/cli/src/adapters/terminal.js.map +1 -1
- package/dist/apps/cli/src/apps/catenv/catenv.d.ts +5 -0
- package/dist/apps/cli/src/apps/catenv/catenv.js +10 -1
- package/dist/apps/cli/src/apps/catenv/catenv.js.map +1 -1
- package/dist/apps/cli/src/catenv.js +7 -0
- package/dist/apps/cli/src/catenv.js.map +1 -1
- package/dist/apps/cli/src/utils/gitlab.js +5 -0
- package/dist/apps/cli/src/utils/gitlab.js.map +1 -1
- package/dist/apps/cli/src/vault/VaultManager.js +6 -1
- package/dist/apps/cli/src/vault/VaultManager.js.map +1 -1
- package/dist/bundles/catenv/index.js +17416 -8850
- package/dist/bundles/cli/index.js +20 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/adapters/terminal.ts +16 -2
- package/src/apps/catenv/catenv.ts +15 -1
- package/src/catenv.ts +12 -0
- package/src/utils/gitlab.ts +7 -0
- package/src/vault/VaultManager.ts +4 -1
|
@@ -219,9 +219,16 @@ function createTerminalIO(options = {}) {
|
|
|
219
219
|
var _a;
|
|
220
220
|
const io = {
|
|
221
221
|
interactive: (_a = options.interactive) !== null && _a !== void 0 ? _a : process.stdin.isTTY === true,
|
|
222
|
-
getVaultManager: (0, vaultManagerAccess_1.createVaultManagerGetter)(() => io
|
|
222
|
+
getVaultManager: (0, vaultManagerAccess_1.createVaultManagerGetter)(() => io, {
|
|
223
|
+
mode: options.vaultMode,
|
|
224
|
+
}),
|
|
223
225
|
log(message) {
|
|
224
|
-
|
|
226
|
+
if (options.logToStderr) {
|
|
227
|
+
console.error(message);
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
console.log(message);
|
|
231
|
+
}
|
|
225
232
|
},
|
|
226
233
|
async confirm(message) {
|
|
227
234
|
var _a;
|
|
@@ -6711,6 +6718,11 @@ const getGitlabToken = async (io) => {
|
|
|
6711
6718
|
console.error("⚠️ gitlab token missing, please run catladder to set it up");
|
|
6712
6719
|
process.exit(1);
|
|
6713
6720
|
}
|
|
6721
|
+
if (!io.interactive) {
|
|
6722
|
+
// don't start the setup wizard in a context that cannot prompt
|
|
6723
|
+
// (direnv, turbo, CI) — fail with the remedy instead
|
|
6724
|
+
throw new Error("gitlab token missing — run `catenv` (or any `catladder` command) once in a terminal to set it up");
|
|
6725
|
+
}
|
|
6714
6726
|
await (0, exports.setupGitlabToken)(io);
|
|
6715
6727
|
}
|
|
6716
6728
|
return (0, preferences_1.getPreference)(TOKEN_KEY);
|
|
@@ -7428,12 +7440,17 @@ class VaultManager {
|
|
|
7428
7440
|
this.vault = this.createVault();
|
|
7429
7441
|
}
|
|
7430
7442
|
createVault() {
|
|
7443
|
+
var _a, _b;
|
|
7431
7444
|
const vaultConfig = (0, pipeline_1.getVaultConfig)(this.config);
|
|
7432
7445
|
switch (vaultConfig.type) {
|
|
7433
7446
|
case "gitlab":
|
|
7434
7447
|
return new GitlabVault_1.GitlabVault();
|
|
7435
7448
|
case "bitwarden":
|
|
7436
|
-
return new BitwardenVault_1.BitwardenVault(this.config, vaultConfig,
|
|
7449
|
+
return new BitwardenVault_1.BitwardenVault(this.config, vaultConfig,
|
|
7450
|
+
// unlock prompts need a mode that allows them AND an IO that
|
|
7451
|
+
// can actually prompt (catenv under direnv/turbo/CI cannot)
|
|
7452
|
+
(this.mode === "auto" || this.mode === "refresh") &&
|
|
7453
|
+
((_b = (_a = this.io) === null || _a === void 0 ? void 0 : _a.interactive) !== null && _b !== void 0 ? _b : true));
|
|
7437
7454
|
}
|
|
7438
7455
|
}
|
|
7439
7456
|
/**
|