From 578a7c607717f3cc0e49d2a25f9d0f61506c3652 Mon Sep 17 00:00:00 2001 From: Tobias Klonk Date: Sun, 23 Jul 2023 16:34:53 +0200 Subject: [PATCH] fix BUNDLE_GEMFILE ENV, for working folders containing spaces --- src/client.ts | 10 +++++----- src/ruby.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client.ts b/src/client.ts index a62caa2e..445bb2ef 100644 --- a/src/client.ts +++ b/src/client.ts @@ -433,20 +433,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 = `BUNDLE_GEMFILE="${customBundleGemfile}"`; } else if ( fs.existsSync(path.join(this.workingFolder, ".ruby-lsp", "Gemfile")) ) { - bundleGemfile = `BUNDLE_GEMFILE=${path.join( + bundleGemfile = `BUNDLE_GEMFILE="${path.join( this.workingFolder, ".ruby-lsp", "Gemfile", - )}`; + )}"`; } else { - bundleGemfile = `BUNDLE_GEMFILE=${path.join( + bundleGemfile = `BUNDLE_GEMFILE="${path.join( this.workingFolder, "Gemfile", - )}`; + )}"`; } const result = await asyncExec( diff --git a/src/ruby.ts b/src/ruby.ts index 35047697..c2896c55 100644 --- a/src/ruby.ts +++ b/src/ruby.ts @@ -214,7 +214,7 @@ export class Ruby { ); } - this._env.BUNDLE_GEMFILE = absoluteBundlePath; + this._env.BUNDLE_GEMFILE = `"${absoluteBundlePath}"`; } private async readRubyVersion() {