Skip to content

Commit

Permalink
Fix status bar button in folders with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
xethlyx committed Sep 30, 2021
1 parent 847755a commit 6ea6ee1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,16 @@ export async function activate(context: vscode.ExtensionContext) {
const compilerCommand = development ? "rbxtsc-dev" : "rbxtsc";

// Detect if there is a local install
const localInstall = path.join(workspacePath, "node_modules", ".bin", "rbxtsc");
const localInstallPath = path.join(workspacePath, "node_modules", ".bin");
const localInstallFile = "rbxtsc";

vscode.commands.executeCommand('setContext', 'roblox-ts:compilerActive', true);
if (!development && fs.existsSync(localInstall)) {
if (!development && fs.existsSync(path.join(localInstallPath, localInstallFile))) {
outputChannel.appendLine("Detected local install, using local install instead of global");
compilerProcess = childProcess.spawn(localInstall, parameters, options);
compilerProcess = childProcess.spawn(localInstallFile, parameters, {
...options,
cwd: localInstallPath
});
} else {
compilerProcess = childProcess.spawn(compilerCommand, parameters, options);
}
Expand Down

0 comments on commit 6ea6ee1

Please sign in to comment.