From f6963b1c451afcb2f0d0104f38178235e52f8b63 Mon Sep 17 00:00:00 2001 From: ewy Date: Tue, 14 Apr 2026 20:13:13 +0200 Subject: remove all name repetition --- runner/python/filetarget.go | 51 --------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 runner/python/filetarget.go (limited to 'runner/python/filetarget.go') 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 -} -- cgit v1.3