Skip to content

Commit

Permalink
Write deps.edn win jack-in command line to a file
Browse files Browse the repository at this point in the history
Then execute that file
Fixes #1162
  • Loading branch information
PEZ committed May 1, 2021
1 parent 25c2c7a commit 4ec9bb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/nrepl/jack-in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ async function getJackInTerminalOptions(projectConnectSequence: ReplConnectSeque
}
executable = cmd[0];
args = [...cmd.slice(1), ...args];
if (projectTypes.isWin && projectType.resolveBundledPathWin) {
const cmdFile = path.join('.calva', 'start.cmd');
const cmdFileUri = vscode.Uri.file(path.join(state.getProjectRootLocal(), '.calva', 'start.cmd'))
utilities.writeTextToFile(cmdFileUri, createCommandLine(executable, args))
executable = cmdFile;
args = [];
}

const terminalOptions: JackInTerminalOptions = {
name: `Calva Jack-in: ${projectConnectSequence.name}`,
Expand Down
6 changes: 3 additions & 3 deletions src/nrepl/project-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const cljsMiddleware: { [id: string]: string[] } = {
const serverPrinterDependencies = pprint.getServerSidePrinterDependencies();

function depsCljWindowsPath() {
return `"${path.join('.', '.calva', 'deps.clj.jar')}"`;
return `${path.join('.', '.calva', 'deps.clj.jar')}`;
}

const projectTypes: { [id: string]: ProjectType } = {
Expand Down Expand Up @@ -368,7 +368,7 @@ const projectTypes: { [id: string]: ProjectType } = {
resolveBundledPathWin: depsCljWindowsPath,
resolveBundledPathUnix: () => `'${path.join(state.extensionContext.extensionPath, 'deps.clj.jar')}'`,
processShellUnix: true,
processShellWin: true,
processShellWin: false,
useWhenExists: undefined,
nReplPortFile: [".nrepl-port"],
commandLine: async (connectSequence: ReplConnectSequence, cljsType: CljsTypes) => {
Expand Down Expand Up @@ -458,7 +458,7 @@ async function cljCommandLine(connectSequence: ReplConnectSequence, cljsType: Cl
if (selectedAliasesHasMain) {
args.push(aliasesOption);
} else {
args.push(aliasesOption, "-m", "nrepl.cmdline", "--middleware", `"[${useMiddleware.join(' ')}]"`);
args.push(aliasesOption, "-m", "nrepl.cmdline", "--middleware", `${q}[${useMiddleware.join(' ')}]${q}`);
}

return args;
Expand Down

0 comments on commit 4ec9bb5

Please sign in to comment.