blob: db3fcc83a94164bb8c464c4a8c035ad76f0972ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package shell
import (
"os/exec"
"path/filepath"
"pik/model"
"pik/runner"
)
type Target struct {
runner.BaseTarget
Shell string
Script string
SubValue []string
}
func (s *Target) String() string {
return s.Label()
}
func (s *Target) Hydrate(_ *model.Source) (model.HydratedTarget, error) {
return Runner.Hydrate(s)
}
func (s *Target) Sub() []string {
return s.SubValue
}
func (s *Target) Label() string {
return s.Identity.Full
}
func (s *Target) Create(src *model.Source) *exec.Cmd {
return exec.Command(s.Shell, filepath.Join(src.Path, s.Script))
}
|