MCPcopy Create free account
hub / github.com/WendellCraft/ModpackDebuggerKit / DeleteSelectedHangingLibs

Method DeleteSelectedHangingLibs

app.go:960–983  ·  view source on GitHub ↗
(libs []string)

Source from the content-addressed store, hash-verified

958}
959
960func (a *App) DeleteSelectedHangingLibs(libs []string) error {
961 a.mu.Lock()
962 modsDir := a.ProjectData.ModsDir
963 a.mu.Unlock()
964
965 if modsDir == "" {
966 return fmt.Errorf("no mod folder selected")
967 }
968
969 for _, lib := range libs {
970 libPath := filepath.Join(modsDir, lib)
971 if err := os.Remove(libPath); err != nil {
972 if !os.IsNotExist(err) {
973 a.emitLog(fmt.Sprintf("Error deleting %s: %v", lib, err), LogError)
974 }
975 } else {
976 a.emitLog(fmt.Sprintf("Deleted hanging library: %s", lib), LogWarning)
977 }
978 }
979
980 a.markModified()
981 a.updateHangingLibraries()
982 return nil
983}
984
985func (a *App) DismissSelectedHangingLibs(libs []string) {
986 a.mu.Lock()

Callers

nothing calls this directly

Calls 3

emitLogMethod · 0.95
markModifiedMethod · 0.95

Tested by

no test coverage detected