From 02901137f46024469d8c305cbbc94d85531475bd Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Mon, 24 Jul 2023 07:55:33 -0600 Subject: [PATCH] Put BUNDLE_GEMFILE in the env rather than preceding the command Windows doesn't play well with `ENV_VAR=123 command`. We should always prefer to pass the `env` key instead --- src/client.ts | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/client.ts b/src/client.ts index e7b5ee5c..c0c39673 100644 --- a/src/client.ts +++ b/src/client.ts @@ -438,27 +438,20 @@ export default class Client implements ClientInterface { // If a custom Gemfile was configured outside of the project, use that. Otherwise, prefer our custom bundle over the // app's bundle if (customBundleGemfile.length > 0) { - bundleGemfile = `BUNDLE_GEMFILE=${customBundleGemfile}`; + bundleGemfile = customBundleGemfile; } else if ( fs.existsSync(path.join(this.workingFolder, ".ruby-lsp", "Gemfile")) ) { - bundleGemfile = `BUNDLE_GEMFILE=${path.join( - this.workingFolder, - ".ruby-lsp", - "Gemfile", - )}`; + bundleGemfile = path.join(this.workingFolder, ".ruby-lsp", "Gemfile"); } else { - bundleGemfile = `BUNDLE_GEMFILE=${path.join( - this.workingFolder, - "Gemfile", - )}`; + bundleGemfile = path.join(this.workingFolder, "Gemfile"); } const result = await asyncExec( - `${bundleGemfile} bundle exec ruby -e "require 'ruby-lsp'; print RubyLsp::VERSION"`, + `bundle exec ruby -e "require 'ruby-lsp'; print RubyLsp::VERSION"`, { cwd: this.workingFolder, - env: this.ruby.env, + env: { ...this.ruby.env, BUNDLE_GEMFILE: bundleGemfile }, }, );