@seekrit/cli 0.28.0 → 0.29.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/index.js +32 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -208,6 +208,37 @@ function parseBranchTtl(input) {
|
|
|
208
208
|
return value * multiplier;
|
|
209
209
|
}
|
|
210
210
|
//#endregion
|
|
211
|
+
//#region ../../packages/core/src/dotenv.ts
|
|
212
|
+
/**
|
|
213
|
+
* Minimal `.env` parser: `KEY=VALUE`, `#` comments, an optional `export`
|
|
214
|
+
* prefix, and single/double-quoted values (double quotes honor `\n \t \r \" \\`
|
|
215
|
+
* escapes; unquoted values drop trailing ` # comments`). Multiline values are
|
|
216
|
+
* not supported — keep those in seekrit itself.
|
|
217
|
+
*/
|
|
218
|
+
function parseDotenv(content) {
|
|
219
|
+
const out = {};
|
|
220
|
+
for (const raw of content.split(/\r?\n/)) {
|
|
221
|
+
let line = raw.trim();
|
|
222
|
+
if (!line || line.startsWith("#")) continue;
|
|
223
|
+
if (line.startsWith("export ")) line = line.slice(7).trimStart();
|
|
224
|
+
const eq = line.indexOf("=");
|
|
225
|
+
if (eq === -1) continue;
|
|
226
|
+
const key = line.slice(0, eq).trim();
|
|
227
|
+
if (!key) continue;
|
|
228
|
+
let value = line.slice(eq + 1).trim();
|
|
229
|
+
const quote = value[0];
|
|
230
|
+
if (value.length >= 2 && (quote === "\"" || quote === "'") && value.at(-1) === quote) {
|
|
231
|
+
value = value.slice(1, -1);
|
|
232
|
+
if (quote === "\"") value = value.replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, " ").replace(/\\"/g, "\"").replace(/\\\\/g, "\\");
|
|
233
|
+
} else {
|
|
234
|
+
const comment = value.indexOf(" #");
|
|
235
|
+
if (comment !== -1) value = value.slice(0, comment).trim();
|
|
236
|
+
}
|
|
237
|
+
out[key] = value;
|
|
238
|
+
}
|
|
239
|
+
return out;
|
|
240
|
+
}
|
|
241
|
+
//#endregion
|
|
211
242
|
//#region ../../packages/core/src/ids.ts
|
|
212
243
|
const ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
213
244
|
/**
|
|
@@ -2497,7 +2528,7 @@ function isCliSessionToken(value) {
|
|
|
2497
2528
|
}
|
|
2498
2529
|
//#endregion
|
|
2499
2530
|
//#region package.json
|
|
2500
|
-
var version = "0.
|
|
2531
|
+
var version = "0.29.0";
|
|
2501
2532
|
//#endregion
|
|
2502
2533
|
//#region ../../packages/api-client/src/index.ts
|
|
2503
2534
|
var SeekritApiError = class extends Error {
|
|
@@ -4591,37 +4622,6 @@ function registerBranchCommands(program) {
|
|
|
4591
4622
|
});
|
|
4592
4623
|
}
|
|
4593
4624
|
//#endregion
|
|
4594
|
-
//#region src/dotenv.ts
|
|
4595
|
-
/**
|
|
4596
|
-
* Minimal `.env` parser: `KEY=VALUE`, `#` comments, an optional `export`
|
|
4597
|
-
* prefix, and single/double-quoted values (double quotes honor `\n \t \r \" \\`
|
|
4598
|
-
* escapes; unquoted values drop trailing ` # comments`). Multiline values are
|
|
4599
|
-
* not supported — keep those in seekrit itself.
|
|
4600
|
-
*/
|
|
4601
|
-
function parseDotenv(content) {
|
|
4602
|
-
const out = {};
|
|
4603
|
-
for (const raw of content.split(/\r?\n/)) {
|
|
4604
|
-
let line = raw.trim();
|
|
4605
|
-
if (!line || line.startsWith("#")) continue;
|
|
4606
|
-
if (line.startsWith("export ")) line = line.slice(7).trimStart();
|
|
4607
|
-
const eq = line.indexOf("=");
|
|
4608
|
-
if (eq === -1) continue;
|
|
4609
|
-
const key = line.slice(0, eq).trim();
|
|
4610
|
-
if (!key) continue;
|
|
4611
|
-
let value = line.slice(eq + 1).trim();
|
|
4612
|
-
const quote = value[0];
|
|
4613
|
-
if (value.length >= 2 && (quote === "\"" || quote === "'") && value.at(-1) === quote) {
|
|
4614
|
-
value = value.slice(1, -1);
|
|
4615
|
-
if (quote === "\"") value = value.replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, " ").replace(/\\"/g, "\"").replace(/\\\\/g, "\\");
|
|
4616
|
-
} else {
|
|
4617
|
-
const comment = value.indexOf(" #");
|
|
4618
|
-
if (comment !== -1) value = value.slice(0, comment).trim();
|
|
4619
|
-
}
|
|
4620
|
-
out[key] = value;
|
|
4621
|
-
}
|
|
4622
|
-
return out;
|
|
4623
|
-
}
|
|
4624
|
-
//#endregion
|
|
4625
4625
|
//#region src/format.ts
|
|
4626
4626
|
function needsQuoting(value) {
|
|
4627
4627
|
return /[\s"'`$\\#]/.test(value) || value === "";
|