summaryrefslogtreecommitdiff
path: root/runner/shell/target.go
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-04-14 16:37:17 +0200
committerewy <ewy0@protonmail.com>2026-04-14 16:37:17 +0200
commit45a297a8e526094e8fce6e2c5c0fd89b381d1765 (patch)
tree852ebc3a0112c94dc9726d0b27ab057bf6383660 /runner/shell/target.go
i have to commit at some point!
Diffstat (limited to 'runner/shell/target.go')
-rw-r--r--runner/shell/target.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/runner/shell/target.go b/runner/shell/target.go
new file mode 100644
index 0000000..e823d41
--- /dev/null
+++ b/runner/shell/target.go
@@ -0,0 +1,35 @@
+package shell
+
+import (
+ "os/exec"
+ "path/filepath"
+ "pik/model"
+ "pik/runner"
+)
+
+type ShellTarget struct {
+ runner.BaseTarget
+ Shell string
+ Script string
+ SubValue []string
+}
+
+func (s *ShellTarget) String() string {
+ return s.Label()
+}
+
+func (s *ShellTarget) Hydrate(_ *model.Source) (model.HydratedTarget, error) {
+ return Runner.Hydrate(s)
+}
+
+func (s *ShellTarget) Sub() []string {
+ return s.SubValue
+}
+
+func (s *ShellTarget) Label() string {
+ return s.Identity.Full
+}
+
+func (s *ShellTarget) Create(src *model.Source) *exec.Cmd {
+ return exec.Command(s.Shell, filepath.Join(src.Path, s.Script))
+}