From 90e845803f030083a87d49ec6291883f66e36126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Str=C3=B6mberg?= Date: Wed, 3 Jul 2024 17:19:49 +0200 Subject: [PATCH] Don't use shell and always use deps.clj on windows * Fixes #2592 --- src/nrepl/project-types.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/nrepl/project-types.ts b/src/nrepl/project-types.ts index 96148fc03..b50298b23 100644 --- a/src/nrepl/project-types.ts +++ b/src/nrepl/project-types.ts @@ -329,7 +329,6 @@ function depsCljWindowsPath() { } const clojureCmdFn = () => { - const q = isWin ? '"' : "'"; const configuredCmd = getConfig().depsEdnJackInExecutable === 'clojure or deps.clj' ? getStateValue('depsEdnJackInDefaultExecutable') ?? 'deps.clj' @@ -339,6 +338,10 @@ const clojureCmdFn = () => { : ['clojure']; }; +const clojureCmdWinFn = () => { + return ['java', '-jar', `${path.join(state.extensionContext.extensionPath, 'deps.clj.jar')}`]; +}; + const projectTypes: { [id: string]: ProjectType } = { lein: { name: 'Leiningen', @@ -375,10 +378,10 @@ const projectTypes: { [id: string]: ProjectType } = { 'ClojureScript built-in for node', ], cmd: clojureCmdFn, - winCmd: clojureCmdFn, + winCmd: clojureCmdWinFn, resolveBundledPathWin: depsCljWindowsPath, processShellUnix: true, - processShellWin: true, + processShellWin: false, useWhenExists: ['deps.edn'], nReplPortFile: ['.nrepl-port'], /** Build the command line args for a clj-project. @@ -669,7 +672,7 @@ async function cljCommandLine(connectSequence: ReplConnectSequence, cljsType: Cl const aliasesOption = aliases.length > 0 ? `${aliasesFlag[0]}${aliases.join('')}` : aliasesFlag[1]; const q = isWin ? '"' : "'"; - const dQ = isWin ? '""' : '"'; + const dQ = isWin ? '\\"' : '"'; for (const dep in dependencies) { out.push(dep + ` {:mvn/version,${dQ}${dependencies[dep]}${dQ}}`); }