Skip to content

Commit 2e861af

Browse files
committed
fixed failing tests
1 parent 198e68d commit 2e861af

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

vscode/src/test/launchNbcode.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@ import * as os from 'os';
44
import { env } from 'process';
55
import { ChildProcessByStdio, spawn } from 'child_process';
66
import { Readable } from 'stream';
7-
import { findNbcode } from '../lsp/utils';
7+
8+
const findNbcode = (extensionPath: string): string => {
9+
let nbcode = os.platform() === 'win32' ?
10+
os.arch() === 'x64' ? 'nbcode64.exe' : 'nbcode.exe'
11+
: 'nbcode.sh';
12+
let nbcodePath = path.join(extensionPath, "nbcode", "bin", nbcode);
13+
14+
let nbcodePerm = fs.statSync(nbcodePath);
15+
if (!nbcodePerm.isFile()) {
16+
throw `Cannot execute ${nbcodePath}`;
17+
}
18+
if (os.platform() !== 'win32') {
19+
fs.chmodSync(path.join(extensionPath, "nbcode", "bin", nbcode), "744");
20+
fs.chmodSync(path.join(extensionPath, "nbcode", "platform", "lib", "nbexec.sh"), "744");
21+
fs.chmodSync(path.join(extensionPath, "nbcode", "java", "maven", "bin", "mvn.sh"), "744");
22+
}
23+
return nbcodePath;
24+
}
825

926
if (typeof process === 'object' && process.argv0 === 'node') {
1027
let extension = path.join(process.argv[1], '..', '..', '..');

0 commit comments

Comments
 (0)