diff --git a/cargo-generate.toml b/cargo-generate.toml index efa3ccc..8dcf2a3 100644 --- a/cargo-generate.toml +++ b/cargo-generate.toml @@ -1,6 +1,6 @@ [template] cargo_generate_version = ">=0.10.0" -ignore = [".github", "test.py"] +ignore = [".github", "main.go"] [placeholders.program_type] type = "string" diff --git a/main.go b/main.go index 3578a6f..1ee5a40 100644 --- a/main.go +++ b/main.go @@ -167,7 +167,7 @@ func run() error { ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() - cmd := exec.CommandContext(ctx, "cargo", "xtask", "run") + cmd := exec.CommandContext(ctx, "sh", "-c", "cargo xtask run") cmd.Dir = projectDir cmd.Stderr = os.Stderr // Prevent the child process from being in our process group so that we can send it a SIGINT @@ -193,7 +193,7 @@ func run() error { panic(err) } if strings.Contains(text, "Waiting for Ctrl-C") { - syscall.Kill(-cmd.Process.Pid, syscall.SIGINT) + cmd.Process.Signal(os.Interrupt) } } if err := scanner.Err(); err != nil {