@dishantlangayan/sc-cli-core 0.5.2 → 0.5.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.
@@ -299,6 +299,19 @@ export class OrgManager {
299
299
  if (!this.masterKey || !this.machineId) {
300
300
  throw new OrgError('Org manager not initialized', OrgErrorCode.NOT_INITIALIZED);
301
301
  }
302
+ // If storage is empty, delete the file instead of saving
303
+ if (this.storage.orgs.length === 0) {
304
+ try {
305
+ await unlink(this.configFile);
306
+ }
307
+ catch (error) {
308
+ // Ignore if file doesn't exist (ENOENT)
309
+ if (error.code !== 'ENOENT') {
310
+ throw error;
311
+ }
312
+ }
313
+ return;
314
+ }
302
315
  // Ensure directory exists
303
316
  await mkdir(this.configDir, { mode: 0o700, recursive: true });
304
317
  // Generate new salt and derive key for THIS save
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dishantlangayan/sc-cli-core",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Base library for the Solace Cloud CLI and plugins",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Dishant Langayan",