periderm-cli 0.1.11 → 0.1.12
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/config.js +0 -21
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -3,27 +3,6 @@ import path from "node:path";
|
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
const CONFIG_DIR = path.join(os.homedir(), ".periderm");
|
|
5
5
|
const CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
|
|
6
|
-
// Auto-load .env from current directory for local testing
|
|
7
|
-
try {
|
|
8
|
-
const envPath = path.join(process.cwd(), '.env');
|
|
9
|
-
if (fs.existsSync(envPath)) {
|
|
10
|
-
const content = fs.readFileSync(envPath, 'utf8');
|
|
11
|
-
for (const line of content.split('\n')) {
|
|
12
|
-
const match = line.match(/^\s*(?:export\s+)?([\w.-]+)\s*=\s*(.*)?\s*$/);
|
|
13
|
-
if (match) {
|
|
14
|
-
const key = match[1];
|
|
15
|
-
let val = match[2] || '';
|
|
16
|
-
if (val.startsWith('"') && val.endsWith('"'))
|
|
17
|
-
val = val.slice(1, -1);
|
|
18
|
-
else if (val.startsWith("'") && val.endsWith("'"))
|
|
19
|
-
val = val.slice(1, -1);
|
|
20
|
-
if (!process.env[key])
|
|
21
|
-
process.env[key] = val;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
catch (e) { }
|
|
27
6
|
const DEFAULT_API_URL = process.env.PERIDERM_API_URL || "https://periderm-cli.vercel.app";
|
|
28
7
|
export function readConfig() {
|
|
29
8
|
try {
|