summaryrefslogtreecommitdiff
path: root/runner/shell
diff options
context:
space:
mode:
Diffstat (limited to 'runner/shell')
-rw-r--r--runner/shell/hydrated.go8
-rw-r--r--runner/shell/shell.go6
-rw-r--r--runner/shell/target.go12
3 files changed, 13 insertions, 13 deletions
diff --git a/runner/shell/hydrated.go b/runner/shell/hydrated.go
index 77fc45c..e1f8892 100644
--- a/runner/shell/hydrated.go
+++ b/runner/shell/hydrated.go
@@ -6,15 +6,15 @@ import (
"pik/spool"
)
-type HydratedShellTarget struct {
- runner.BaseHydration[*ShellTarget]
+type Hydrated struct {
+ runner.BaseHydration[*Target]
}
-func (h *HydratedShellTarget) Icon() string {
+func (h *Hydrated) Icon() string {
return "\uF489"
}
-func (h *HydratedShellTarget) Description() string {
+func (h *Hydrated) Description() string {
desc, err := describe.Describe(h.BaseTarget.Script)
if err != nil {
spool.Warn("%v\n", err)
diff --git a/runner/shell/shell.go b/runner/shell/shell.go
index 5333279..9d34e0f 100644
--- a/runner/shell/shell.go
+++ b/runner/shell/shell.go
@@ -38,11 +38,11 @@ type shell struct {
var WrongTargetError = errors.New("wrong target type")
func (s *shell) Hydrate(target model.Target) (model.HydratedTarget, error) {
- cast, ok := target.(*ShellTarget)
+ cast, ok := target.(*Target)
if !ok {
return nil, WrongTargetError
}
- hyd := &HydratedShellTarget{BaseHydration: runner.Hydrated(cast)}
+ hyd := &Hydrated{BaseHydration: runner.Hydrated(cast)}
return hyd, nil
}
@@ -102,7 +102,7 @@ func (s *shell) CreateTarget(fs fs.FS, src string, file string, _ fs.DirEntry) (
}
sub = append(sub, p)
}
- return &ShellTarget{
+ return &Target{
BaseTarget: runner.BaseTarget{
Identity: identity.New(filename),
MyTags: model.TagsFromFilename(filename),
diff --git a/runner/shell/target.go b/runner/shell/target.go
index e823d41..db3fcc8 100644
--- a/runner/shell/target.go
+++ b/runner/shell/target.go
@@ -7,29 +7,29 @@ import (
"pik/runner"
)
-type ShellTarget struct {
+type Target struct {
runner.BaseTarget
Shell string
Script string
SubValue []string
}
-func (s *ShellTarget) String() string {
+func (s *Target) String() string {
return s.Label()
}
-func (s *ShellTarget) Hydrate(_ *model.Source) (model.HydratedTarget, error) {
+func (s *Target) Hydrate(_ *model.Source) (model.HydratedTarget, error) {
return Runner.Hydrate(s)
}
-func (s *ShellTarget) Sub() []string {
+func (s *Target) Sub() []string {
return s.SubValue
}
-func (s *ShellTarget) Label() string {
+func (s *Target) Label() string {
return s.Identity.Full
}
-func (s *ShellTarget) Create(src *model.Source) *exec.Cmd {
+func (s *Target) Create(src *model.Source) *exec.Cmd {
return exec.Command(s.Shell, filepath.Join(src.Path, s.Script))
}