@eventmodelers/node-kit 0.0.7 → 0.0.9
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/src/cli.js +6 -0
- package/templates/realtime-agent/src/index.js +12 -1
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -123,6 +123,12 @@ program
|
|
|
123
123
|
const configPath = join(configDir, 'config.json');
|
|
124
124
|
mkdirSync(configDir, { recursive: true });
|
|
125
125
|
|
|
126
|
+
const hasExisting = await prompt('\nDo you have an existing config from app.eventmodelers.de/account? (y/n): ');
|
|
127
|
+
if (hasExisting.toLowerCase() === 'y' || hasExisting.toLowerCase() === 'yes') {
|
|
128
|
+
console.log(`\n Paste your config into:\n\n ${configPath}\n\n Then re-run this installer.\n`);
|
|
129
|
+
process.exit(0);
|
|
130
|
+
}
|
|
131
|
+
|
|
126
132
|
let config = {};
|
|
127
133
|
if (existsSync(configPath)) {
|
|
128
134
|
try {
|
|
@@ -6,8 +6,19 @@ import { randomUUID } from 'crypto';
|
|
|
6
6
|
|
|
7
7
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
8
|
|
|
9
|
+
function findConfigPath(startDir) {
|
|
10
|
+
let dir = startDir;
|
|
11
|
+
while (true) {
|
|
12
|
+
const candidate = join(dir, '.eventmodelers', 'config.json');
|
|
13
|
+
if (existsSync(candidate)) return candidate;
|
|
14
|
+
const parent = dirname(dir);
|
|
15
|
+
if (parent === dir) throw new Error('No .eventmodelers/config.json found in current directory or any parent directory');
|
|
16
|
+
dir = parent;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
9
20
|
function loadLocalConfig() {
|
|
10
|
-
const configPath =
|
|
21
|
+
const configPath = findConfigPath(process.cwd());
|
|
11
22
|
const raw = readFileSync(configPath, 'utf-8');
|
|
12
23
|
const cfg = JSON.parse(raw);
|
|
13
24
|
|