File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -67,18 +67,23 @@ 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 default_options = {
71+ env : Object . assign ( { } , process . env , { LANG : getLang ( ) } ) ,
72+ stdio : [ "ignore" , "ignore" , "inherit" ] ,
73+ detached : true
74+ } ;
75+ const options = opts . filepath
76+ ? { cwd : path . dirname ( opts . filepath ) , ...default_options }
77+ : default_options ;
78+
7079 const server = spawn (
7180 opts . rubyExecutablePath || "ruby" ,
7281 [
7382 url . fileURLToPath ( new URL ( "./server.rb" , import . meta. url ) ) ,
7483 `--plugins=${ getPlugins ( opts ) . join ( "," ) } ` ,
7584 filepath
7685 ] ,
77- {
78- env : Object . assign ( { } , process . env , { LANG : getLang ( ) } ) ,
79- stdio : [ "ignore" , "ignore" , "inherit" ] ,
80- detached : true
81- }
86+ options
8287 ) ;
8388
8489 server . unref ( ) ;
You can’t perform that action at this time.
0 commit comments