This commit is contained in:
Lukas Wurzinger 2025-06-22 00:27:39 +02:00
commit 97ddcea8f3
No known key found for this signature in database
11 changed files with 1283 additions and 0 deletions

29
spec.go Normal file
View file

@ -0,0 +1,29 @@
package main
import (
"os"
"os/exec"
)
type SpecEntry struct {
DisplayName string `json:"displayName"`
Program string `json:"program"`
Args []string `json:"args"`
Argv0 string `json:"argv0"`
// TODO: env?
}
func (e SpecEntry) Run() (*os.ProcessState, error) {
cmd := exec.Command(e.Program, e.Args...)
cmd.Args[0] = e.Argv0
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.ProcessState, cmd.Run()
}
type Spec struct {
Entries []SpecEntry `json:"entries"`
}