MCPcopy Create free account
hub / github.com/EvilFreelancer/openapi-to-cli / removeProfile

Method removeProfile

src/profile-store.ts:116–129  ·  view source on GitHub ↗
(cwd: string, name: string)

Source from the content-addressed store, hash-verified

114 }
115
116 removeProfile(cwd: string, name: string): void {
117 const configPaths = this.getConfigPaths(cwd);
118 if (!this.fs.existsSync(configPaths.profilesIniPath)) {
119 return;
120 }
121 const currentName = this.getCurrentProfileName(cwd);
122 const iniData = this.readIni(cwd);
123 delete iniData[name];
124 const serialized = ini.encode(iniData);
125 this.fs.writeFileSync(configPaths.profilesIniPath, serialized);
126 if (currentName === name) {
127 this.writeCurrentProfileName(configPaths, "default");
128 }
129 }
130
131 setCurrentProfile(cwd: string, name: string): void {
132 const configPaths = this.getConfigPaths(cwd);

Callers 2

runFunction · 0.80

Calls 6

getConfigPathsMethod · 0.95
getCurrentProfileNameMethod · 0.95
readIniMethod · 0.95
existsSyncMethod · 0.65
writeFileSyncMethod · 0.65

Tested by

no test coverage detected