(cwd: string, name: string)
| 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); |
no test coverage detected