File: runner.go

package info (click to toggle)
landrun 0.1.15-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 196 kB
  • sloc: sh: 222; makefile: 14
file content (21 lines) | stat: -rw-r--r-- 408 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package exec

import (
	"os/exec"
	"syscall"

	"github.com/zouuup/landrun/internal/log"
)

func Run(args []string, env []string) error {
	binary, err := exec.LookPath(args[0])
	if err != nil {
		return err
	}

	log.Info("Executing: %v", args)

	// Only pass the explicitly specified environment variables
	// If env is empty, no environment variables will be passed
	return syscall.Exec(binary, args, env)
}