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