instructionForFile returns the instruction whose managed file equals path.
(ctx context.Context, path string)
| 161 | |
| 162 | // instructionForFile returns the instruction whose managed file equals path. |
| 163 | func (s *Store) instructionForFile(ctx context.Context, path string) (Instruction, bool) { |
| 164 | list, err := s.List(ctx) |
| 165 | if err != nil { |
| 166 | return Instruction{}, false |
| 167 | } |
| 168 | clean := filepath.Clean(path) |
| 169 | for _, in := range list { |
| 170 | if filepath.Clean(managedFilePath(in.Name)) == clean { |
| 171 | return in, true |
| 172 | } |
| 173 | } |
| 174 | return Instruction{}, false |
| 175 | } |
| 176 | |
| 177 | // Uninstall removes the link/copy CAM placed (when safe) and deletes the row. |
| 178 | func (s *Store) Uninstall(ctx context.Context, installID int64) error { |
no test coverage detected