| 1117 | } |
| 1118 | |
| 1119 | func getOperation(operate, pkgManager string) string { |
| 1120 | operations := map[string][2]string{ |
| 1121 | constant.RuntimeInstall: {"install", "add"}, |
| 1122 | constant.RuntimeUninstall: {"uninstall", "remove"}, |
| 1123 | constant.RuntimeUpdate: {"update", "upgrade"}, |
| 1124 | } |
| 1125 | |
| 1126 | ops := operations[operate] |
| 1127 | if pkgManager == constant.RuntimeNpm { |
| 1128 | return ops[0] |
| 1129 | } |
| 1130 | return ops[1] |
| 1131 | } |
| 1132 | |
| 1133 | func handleRuntimeDetailID(runtime model.Runtime) (uint, uint) { |
| 1134 | app, _ := appRepo.GetFirst(appRepo.WithKey(runtime.Type)) |