Skip to content

Commit

Permalink
fix(dap/quickfix): set cwd in shell command
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Oct 29, 2023
1 parent 568ee1b commit 5f94fd7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.2.1] - 2023-10-29

### Fixed
- `dap`/`quickfix` executor: Fix setting `cwd` for shell commands.

## [3.2.0] - 2023-10-29

### Added
Expand Down
8 changes: 7 additions & 1 deletion lua/rustaceanvim/compat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ M.uv = vim.uv or vim.loop

M.system = vim.system
-- wrapper around vim.fn.system to give it a similar API to vim.system
or function(cmd, _, on_exit)
or function(cmd, opts, on_exit)
if opts.cwd then
local shell = require('rustaceanvim.shell')
cmd = shell.chain_commands { 'cd ' .. opts.cwd, table.concat(cmd, ' ') }
---@cast cmd string
end

local output = vim.fn.system(cmd)
local ok = vim.v.shell_error
---@type vim.SystemCompleted
Expand Down

0 comments on commit 5f94fd7

Please sign in to comment.