Skip to content

Commit 18c286c

Browse files
committed
Fix file path
1 parent b01581f commit 18c286c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/plugin.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ export async function spawnServer(opts, killOnExit = true) {
6767
const tmpdir = os.tmpdir();
6868
const filepath = path.join(tmpdir, `prettier-ruby-parser-${process.pid}.txt`);
6969

70+
const currentDir = opts.filepath || process.cwd();
71+
7072
const server = spawn(
7173
opts.rubyExecutablePath || "ruby",
7274
[
@@ -75,7 +77,7 @@ export async function spawnServer(opts, killOnExit = true) {
7577
filepath
7678
],
7779
{
78-
cwd: path.dirname(opts.filepath),
80+
cwd: path.dirname(currentDir),
7981
env: Object.assign({}, process.env, { LANG: getLang() }),
8082
stdio: ["ignore", "ignore", "inherit"],
8183
detached: true

0 commit comments

Comments
 (0)