Skip to content

Commit

Permalink
Merge pull request #1748 from posit-dev/mm-windows-r-scan
Browse files Browse the repository at this point in the history
Escape lockfile path
  • Loading branch information
mmarchetti authored May 29, 2024
2 parents 34fd9a8 + 255aaf6 commit 75f95a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/inspect/r.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ func (i *defaultRInspector) CreateLockfile(lockfilePath util.AbsolutePath) error
return err
}

code := fmt.Sprintf(`renv::snapshot(lockfile="%s")`, lockfilePath.String())
escaped := strings.ReplaceAll(lockfilePath.String(), `\`, `\\`)
code := fmt.Sprintf(`renv::snapshot(lockfile="%s")`, escaped)
args := []string{"-s", "-e", code}
stdout, stderr, err := i.executor.RunCommand(rExecutable, args, i.base, i.log)
i.log.Debug("renv::snapshot()", "out", string(stdout), "err", string(stderr))
Expand Down

0 comments on commit 75f95a4

Please sign in to comment.