MCPcopy
hub / github.com/rpamis/comet / restoreDefaultConfig

Function restoreDefaultConfig

src/core/openspec.ts:132–146  ·  view source on GitHub ↗
(backup: ConfigBackup | null)

Source from the content-addressed store, hash-verified

130}
131
132function restoreDefaultConfig(backup: ConfigBackup | null): void {
133 if (!backup) return;
134 try {
135 if (backup.hadExisting) {
136 fs.copyFileSync(backup.backupPath, backup.configPath);
137 fs.unlinkSync(backup.backupPath);
138 } else {
139 if (fs.existsSync(backup.configPath)) {
140 fs.unlinkSync(backup.configPath);
141 }
142 }
143 } catch {
144 // Best-effort restore
145 }
146}
147
148function isCommandAvailable(command: string): boolean {
149 try {

Callers 1

installOpenSpecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected