Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling micro run for subfolders #1510

Merged
merged 9 commits into from
Apr 9, 2020
Merged
Prev Previous commit
Next Next commit
Works now
  • Loading branch information
crufter committed Apr 9, 2020
commit 61a747fcbcf42c5f0fbc6d99999980b52585893f
7 changes: 1 addition & 6 deletions runtime/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,7 @@ func (r *runtime) Create(s *Service, opts ...CreateOption) error {
o(&options)
}

dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
if err != nil {
return err
}

options.WorkDir = filepath.Join(dir, s.Source)
options.WorkDir = s.Source
if len(options.Command) == 0 {
options.Command = []string{"go"}
options.Args = []string{"run", "."}
Expand Down
1 change: 1 addition & 0 deletions runtime/local/process/os/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func (p *Process) Fork(exe *process.Executable) (*process.PID, error) {

cmd.Dir = exe.WorkDir
// set env vars
cmd.Env = append(cmd.Env, os.Environ()...)
cmd.Env = append(cmd.Env, exe.Env...)

// create process group
Expand Down