cli: poder no borrar temp
Some checks failed
repro-run Corre repro-run.json

This commit is contained in:
Cat /dev/Nulo 2023-01-30 16:01:29 -03:00
parent da941d82b8
commit db0c4f1af0

5
cli.go
View file

@ -8,12 +8,15 @@ import (
"gitea.nulo.in/Nulo/repro-run/runner" "gitea.nulo.in/Nulo/repro-run/runner"
"github.com/joho/godotenv" "github.com/joho/godotenv"
"golang.org/x/exp/slices"
) )
func main() { func main() {
config, err := readConfig() config, err := readConfig()
must(err) must(err)
dontDeleteTemp := slices.Contains(os.Args, "--dont-delete-temp")
env, err := godotenv.Read() env, err := godotenv.Read()
if err != nil { if err != nil {
log.Printf("Couldn't load env file: %v", err) log.Printf("Couldn't load env file: %v", err)
@ -22,7 +25,7 @@ func main() {
env[k] = strings.ReplaceAll(v, "\\n", "\n") env[k] = strings.ReplaceAll(v, "\\n", "\n")
} }
must(runner.Run(config, "rootfs/", "cache/", ".", nil, false, env)) must(runner.Run(config, "rootfs/", "cache/", ".", nil, dontDeleteTemp, env))
} }
func must(err error, where ...string) { func must(err error, where ...string) {