(c *gin.Context)
| 192 | } |
| 193 | |
| 194 | func (sdr *scriptDrivesRoute) installDrive(c *gin.Context) { |
| 195 | name := c.Param("name") |
| 196 | scripts, e := sdr._loadAvailableDriveScripts(c.Request.Context(), false) |
| 197 | if e != nil { |
| 198 | _ = c.Error(e) |
| 199 | return |
| 200 | } |
| 201 | |
| 202 | ads, ok := utils.ArrayFind(scripts, func(item script.AvailableDriveScript, _ int) bool { return item.Name == name }) |
| 203 | if !ok { |
| 204 | _ = c.Error(err.NewNotFoundError()) |
| 205 | return |
| 206 | } |
| 207 | |
| 208 | if e := script.InstallDriveScript(c.Request.Context(), sdr.config, ads); e != nil { |
| 209 | _ = c.Error(e) |
| 210 | return |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | func (sdr *scriptDrivesRoute) uninstallDrive(c *gin.Context) { |
| 215 | name := c.Param("name") |
nothing calls this directly
no test coverage detected