kodingo-cli 1.0.18 → 1.0.20
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/commands/init.js +3 -1
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -253,7 +253,9 @@ function registerInitCommand(program) {
|
|
|
253
253
|
// ── Save config ──────────────────────────────────────────────────────
|
|
254
254
|
const repoRoot = findRepoRoot(process.cwd());
|
|
255
255
|
const apiUrl = API_BASE;
|
|
256
|
-
|
|
256
|
+
// preserve existing workspaces, never overwrite global token
|
|
257
|
+
const existingConfig = (0, persistence_config_1.readConfig)();
|
|
258
|
+
(0, persistence_config_1.writeConfig)({ ...existingConfig, mode: "cloud", apiUrl });
|
|
257
259
|
(0, persistence_config_1.writeWorkspaceConfig)(repoRoot, { mode: "cloud", apiUrl, token: selectedProject.token });
|
|
258
260
|
ensureGitignoreEntry(repoRoot, ".kortex/");
|
|
259
261
|
console.log(`✔ Connected. Token saved to ${persistence_config_1.CONFIG_PATH}`);
|