diff options
| author | ewy <ewy0@protonmail.com> | 2026-04-14 20:13:13 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-04-14 20:13:13 +0200 |
| commit | f6963b1c451afcb2f0d0104f38178235e52f8b63 (patch) | |
| tree | 791ac29577c358dcc588d2dc8db67a7be5e9b161 /runner/python/filetarget.go | |
| parent | f26f2a1b0d9d2772ce42da34fd99762e5aa3ad32 (diff) | |
remove all name repetition
Diffstat (limited to 'runner/python/filetarget.go')
| -rw-r--r-- | runner/python/filetarget.go | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/runner/python/filetarget.go b/runner/python/filetarget.go deleted file mode 100644 index 6793f4b..0000000 --- a/runner/python/filetarget.go +++ /dev/null @@ -1,51 +0,0 @@ -package python - -import ( - "os/exec" - "path/filepath" - "pik/model" - "pik/runner" -) - -type FileTarget struct { - runner.BaseTarget - File string -} - -type HydratedFileTarget struct { - runner.BaseHydration[*FileTarget] -} - -func (h *HydratedFileTarget) Icon() string { - return "\uE606" -} - -func (p *FileTarget) Create(s *model.Source) *exec.Cmd { - var cmd []string - if Python.Uv != "" { - cmd = []string{Python.Uv, "run", "--", p.File} - } else if venv := Python.VenvFor(s); venv != "" { - cmd = []string{filepath.Join(s.Path, venv, "bin", "python3"), p.File} - } else { - sysPath, err := exec.LookPath("python3") - if err != nil { - return nil - } - cmd = []string{sysPath, p.File} - } - return exec.Command(cmd[0], cmd[1:]...) -} - -func (p *FileTarget) Sub() []string { - return nil -} - -func (p *FileTarget) Label() string { - return p.Full -} - -func (p *FileTarget) Hydrate(src *model.Source) (model.HydratedTarget, error) { - return &HydratedFileTarget{ - BaseHydration: runner.Hydrated(p), - }, nil -} |
