MCPcopy Index your code
hub / github.com/WendellCraft/ModpackDebuggerKit / restoreAllMods

Method restoreAllMods

debug.go:191–212  ·  view source on GitHub ↗
(modsDir string)

Source from the content-addressed store, hash-verified

189}
190
191func (a *App) restoreAllMods(modsDir string) {
192 a.mu.Lock()
193 group := a.CurrentTestGroup
194 a.mu.Unlock()
195
196 allOk := true
197 for _, mod := range group {
198 src := filepath.Join(a.TempDir, mod)
199 dst := filepath.Join(modsDir, mod)
200 if _, err := os.Stat(src); err == nil {
201 if err := moveFile(src, dst); err != nil {
202 allOk = false
203 a.emitLog(fmt.Sprintf("Failed to restore %s: %v", mod, err), LogError)
204 }
205 }
206 }
207 if allOk {
208 os.RemoveAll(a.TempDir)
209 } else {
210 a.emitLog(fmt.Sprintf("Some mods could not be restored. Check %s for remaining files.", a.TempDir), LogWarning)
211 }
212}
213
214func (a *App) getScanCancelled() bool {
215 a.mu.Lock()

Callers 1

runDebugScanMethod · 0.95

Calls 2

emitLogMethod · 0.95
moveFileFunction · 0.85

Tested by

no test coverage detected