@temps-sdk/cli 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/index.js +11 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17731,6 +17731,9 @@ class Conf {
|
|
|
17731
17731
|
|
|
17732
17732
|
// src/config/store.ts
|
|
17733
17733
|
init_output();
|
|
17734
|
+
import { readFile, writeFile, mkdir } from "node:fs/promises";
|
|
17735
|
+
import { existsSync } from "node:fs";
|
|
17736
|
+
import { dirname } from "node:path";
|
|
17734
17737
|
var DEFAULT_CONFIG = {
|
|
17735
17738
|
apiUrl: "http://localhost:3000",
|
|
17736
17739
|
outputFormat: "table",
|
|
@@ -17764,9 +17767,8 @@ function getSecretsPath() {
|
|
|
17764
17767
|
async function loadSecrets() {
|
|
17765
17768
|
const secretsPath = getSecretsPath();
|
|
17766
17769
|
try {
|
|
17767
|
-
|
|
17768
|
-
|
|
17769
|
-
const content = await file.text();
|
|
17770
|
+
if (existsSync(secretsPath)) {
|
|
17771
|
+
const content = await readFile(secretsPath, "utf-8");
|
|
17770
17772
|
const secrets = {};
|
|
17771
17773
|
for (const line of content.split(`
|
|
17772
17774
|
`)) {
|
|
@@ -17790,17 +17792,15 @@ async function loadSecrets() {
|
|
|
17790
17792
|
}
|
|
17791
17793
|
async function saveSecrets(secrets) {
|
|
17792
17794
|
const secretsPath = getSecretsPath();
|
|
17793
|
-
const dir =
|
|
17794
|
-
await
|
|
17795
|
+
const dir = dirname(secretsPath);
|
|
17796
|
+
await mkdir(dir, { recursive: true });
|
|
17795
17797
|
const lines = ["# Temps CLI secrets - DO NOT SHARE THIS FILE"];
|
|
17796
17798
|
for (const [key, value] of Object.entries(secrets)) {
|
|
17797
17799
|
lines.push(`${key}="${value}"`);
|
|
17798
17800
|
}
|
|
17799
|
-
await
|
|
17801
|
+
await writeFile(secretsPath, lines.join(`
|
|
17800
17802
|
`) + `
|
|
17801
|
-
|
|
17802
|
-
const { chmod } = await import("node:fs/promises");
|
|
17803
|
-
await chmod(secretsPath, 384);
|
|
17803
|
+
`, { mode: 384 });
|
|
17804
17804
|
}
|
|
17805
17805
|
var config = {
|
|
17806
17806
|
get(key) {
|
|
@@ -21137,6 +21137,7 @@ async function listRepos(provider) {
|
|
|
21137
21137
|
}
|
|
21138
21138
|
|
|
21139
21139
|
// src/commands/backups/index.ts
|
|
21140
|
+
import { writeFile as writeFile2 } from "node:fs/promises";
|
|
21140
21141
|
init_spinner();
|
|
21141
21142
|
init_output();
|
|
21142
21143
|
function registerBackupsCommands(program2) {
|
|
@@ -21276,7 +21277,7 @@ async function downloadBackup(backupId, options) {
|
|
|
21276
21277
|
});
|
|
21277
21278
|
if (response.data) {
|
|
21278
21279
|
const buffer = Buffer.from(await response.data.arrayBuffer());
|
|
21279
|
-
await
|
|
21280
|
+
await writeFile2(outputPath, buffer);
|
|
21280
21281
|
}
|
|
21281
21282
|
});
|
|
21282
21283
|
success(`Backup downloaded to ${outputPath}`);
|