cli/pkg/cmd/extensions/extension.go
Mislav Marohnić 0d999ddaa1 Rework local extensions for Windows
Replace the implementation that relied on symlinks with the one that
create regular files that act like symlinks: they contain a reference to
the local directory where to find the extension.
2021-07-28 22:47:54 +02:00

33 lines
512 B
Go

package extensions
import (
"path/filepath"
"strings"
)
type Extension struct {
path string
url string
isLocal bool
updateAvailable bool
}
func (e *Extension) Name() string {
return strings.TrimPrefix(filepath.Base(e.path), "gh-")
}
func (e *Extension) Path() string {
return e.path
}
func (e *Extension) URL() string {
return e.url
}
func (e *Extension) IsLocal() bool {
return e.isLocal
}
func (e *Extension) UpdateAvailable() bool {
return e.updateAvailable
}