()
| 241 | } |
| 242 | |
| 243 | func (a *App) SaveProject() error { |
| 244 | a.mu.Lock() |
| 245 | if a.ActiveScan { |
| 246 | a.mu.Unlock() |
| 247 | return fmt.Errorf("cannot save project during an active debug session") |
| 248 | } |
| 249 | if a.ProjectData.ModsDir == "" { |
| 250 | a.mu.Unlock() |
| 251 | return fmt.Errorf("no mod folder selected") |
| 252 | } |
| 253 | filePath := a.ProjectFilePath |
| 254 | a.mu.Unlock() |
| 255 | |
| 256 | if filePath != "" { |
| 257 | return a.saveToFile(filePath) |
| 258 | } |
| 259 | return a.SaveProjectAs() |
| 260 | } |
| 261 | |
| 262 | func (a *App) SaveProjectAs() error { |
| 263 | a.mu.Lock() |
no test coverage detected