Skip to content

Commit

Permalink
Fix bundle lock execution in relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
sfowl committed Oct 19, 2023
1 parent 22449f2 commit 16f1900
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/scan/ruby.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package scan

import (
"embed"
"fmt"
"os"
"os/exec"
"path/filepath"
Expand All @@ -27,7 +28,7 @@ func GetRubyDeps(path string) (map[string]string, error) {
if os.IsNotExist(err) {
log.Debugf("Creating %s with `bundle lock`", lockPath)
// Create Gemfile.lock
cmd := exec.Command("bundle", "lock")
cmd := exec.Command("env", fmt.Sprintf("--chdir=%s", baseDir), "bundle", "lock")
data, err := cmd.CombinedOutput()
if err != nil {
log.Errorf("couldn't create %s: %v: %v", lockPath, err, string(data))
Expand Down

0 comments on commit 16f1900

Please sign in to comment.