Skip to content

Commit 561850e

Browse files
committed
Add quotes around sketch path to allow for spaces
1 parent df97731 commit 561850e

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

client/src/extension.ts

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ interface ProcessingVersion {
1818
let terminal: Terminal | undefined;
1919

2020
export async function activate(context: ExtensionContext) {
21+
// TODO: Check for other Processing plugins and request deactivation if they are installed
22+
2123
const config = workspace.getConfiguration('processing');
2224

2325
let binaryPath = context.asAbsolutePath(join(`install-locator-${process.platform}`, 'bin', 'install-locator'));
@@ -157,35 +159,35 @@ export async function activate(context: ExtensionContext) {
157159

158160

159161
const runSketch = commands.registerCommand('processing.sketch.run', (resource: Uri) => {
160-
if (!resource) {
161-
return;
162-
}
162+
if (!resource) {
163+
return;
164+
}
163165

164-
// Create a new terminal
165-
if (terminal === undefined) {
166-
terminal = window.createTerminal("Sketch");
167-
}
166+
// Create a new terminal
167+
if (terminal === undefined) {
168+
terminal = window.createTerminal("Sketch");
169+
}
168170

169-
// Show the terminal panel
170-
terminal.show(true);
171+
// Show the terminal panel
172+
terminal.show(true);
171173

172-
// clear the terminal
173-
terminal.sendText("clear", true);
174+
// clear the terminal
175+
terminal.sendText("clear", true);
174176

175-
let path = selectedVersion.path;
176-
if (process.platform === "win32") {
177-
// on windows we need to escape spaces
178-
path = `& "${path}"`;
179-
}
177+
let path = selectedVersion.path;
178+
if (process.platform === "win32") {
179+
// on windows we need to escape spaces
180+
path = `& "${path}"`;
181+
}
180182

181-
// Send the command to the terminal
182-
terminal.sendText(
183-
`${path} cli --sketch=${dirname(
184-
resource.fsPath
185-
)} --run`,
186-
true
187-
);
188-
});
183+
// Send the command to the terminal
184+
terminal.sendText(
185+
`${path} cli --sketch="${dirname(
186+
resource.fsPath
187+
)}" --run`,
188+
true
189+
);
190+
});
189191

190192
const stopSketch = commands.registerCommand('processing.sketch.stop', () => {
191193
if (terminal === undefined) {

client/tsconfig.tsbuildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"root":["./src/extension.ts"],"version":"5.7.2"}
1+
{"root":["./src/extension.ts"],"version":"5.8.3"}

0 commit comments

Comments
 (0)