(dir string)
| 212 | } |
| 213 | |
| 214 | func (m *Manager) InstallLocal(dir string) error { |
| 215 | name := filepath.Base(dir) |
| 216 | if err := m.cleanExtensionUpdateDir(name); err != nil { |
| 217 | return err |
| 218 | } |
| 219 | targetLink := filepath.Join(m.installDir(), name) |
| 220 | |
| 221 | if err := os.MkdirAll(filepath.Dir(targetLink), 0755); err != nil { |
| 222 | return err |
| 223 | } |
| 224 | if err := makeSymlink(dir, targetLink); err != nil { |
| 225 | return err |
| 226 | } |
| 227 | |
| 228 | // Check if an executable of the same name exists in the target directory. |
| 229 | // An error here doesn't indicate a failed extension installation, but |
| 230 | // it does indicate that the user will not be able to run the extension until |
| 231 | // the executable file is built or created manually somehow. |
| 232 | if _, err := os.Stat(filepath.Join(dir, name)); err != nil { |
| 233 | if os.IsNotExist(err) { |
| 234 | return &ErrExtensionExecutableNotFound{ |
| 235 | Dir: dir, |
| 236 | Name: name, |
| 237 | } |
| 238 | } |
| 239 | return err |
| 240 | } |
| 241 | return nil |
| 242 | } |
| 243 | |
| 244 | type binManifest struct { |
| 245 | Owner string |
nothing calls this directly
no test coverage detected