Add a build package (#1926)
* Add a build package * fix go mod * package tar
This commit is contained in:
@@ -13,13 +13,13 @@ import (
|
||||
"github.com/micro/go-micro/v3/runtime/local/process"
|
||||
)
|
||||
|
||||
func (p *Process) Exec(exe *process.Executable) error {
|
||||
func (p *Process) Exec(exe *process.Binary) error {
|
||||
cmd := exec.Command(exe.Package.Path)
|
||||
cmd.Dir = exe.Dir
|
||||
return cmd.Run()
|
||||
}
|
||||
|
||||
func (p *Process) Fork(exe *process.Executable) (*process.PID, error) {
|
||||
func (p *Process) Fork(exe *process.Binary) (*process.PID, error) {
|
||||
|
||||
// create command
|
||||
cmd := exec.Command(exe.Package.Path, exe.Args...)
|
||||
|
@@ -4,22 +4,22 @@ package process
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/micro/go-micro/v3/runtime/local/build"
|
||||
"github.com/micro/go-micro/v3/build"
|
||||
)
|
||||
|
||||
// Process manages a running process
|
||||
type Process interface {
|
||||
// Executes a process to completion
|
||||
Exec(*Executable) error
|
||||
Exec(*Binary) error
|
||||
// Creates a new process
|
||||
Fork(*Executable) (*PID, error)
|
||||
Fork(*Binary) (*PID, error)
|
||||
// Kills the process
|
||||
Kill(*PID) error
|
||||
// Waits for a process to exit
|
||||
Wait(*PID) error
|
||||
}
|
||||
|
||||
type Executable struct {
|
||||
type Binary struct {
|
||||
// Package containing executable
|
||||
Package *build.Package
|
||||
// The env variables
|
||||
|
Reference in New Issue
Block a user