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