Skip to content

Commit 7589591

Browse files
committed
chmod
1 parent 0178c59 commit 7589591

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
with:
8383
repo_token: ${{ secrets.GITHUB_TOKEN }}
8484
file: '*.vsix'
85-
tag: ${{ github.ref_name }}
85+
tag: latest
8686
overwrite: true
8787
file_glob: true
8888
body: |

client/src/extension.ts

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,44 @@ interface ProcessingVersion {
1818
let terminal: Terminal | undefined;
1919

2020
export async function activate(context: ExtensionContext) {
21-
// TODO: Add a launch button when a relevant file is open
2221
const config = workspace.getConfiguration('processing');
2322

24-
const binaryPath = context.asAbsolutePath(join(`install-locator-${process.platform}`, 'bin', 'install-locator'));
23+
let binaryPath = context.asAbsolutePath(join(`install-locator-${process.platform}`, 'bin', 'install-locator'));
24+
const javaPath = context.asAbsolutePath(join(`install-locator-${process.platform}`, 'bin', 'java'));
2525

2626
const versions = await new Promise<ProcessingVersion[]>((resolve, reject) => {
27+
// add executable permissions to the binary
28+
if (process.platform !== "win32") {
29+
exec(`chmod +x ${binaryPath}`, (error, stdout, stderr) => {
30+
if (error) {
31+
console.error(`chmod error: ${error}`);
32+
reject(error);
33+
}
34+
if (stderr) {
35+
console.error(`stderr: ${stderr}`);
36+
reject(stderr);
37+
}
38+
});
39+
40+
// add executable permissions to the java binary
41+
exec(`chmod +x ${javaPath}`, (error, stdout, stderr) => {
42+
if (error) {
43+
console.error(`chmod error: ${error}`);
44+
reject(error);
45+
}
46+
if (stderr) {
47+
console.error(`stderr: ${stderr}`);
48+
reject(stderr);
49+
}
50+
});
51+
} else {
52+
// on windows we need to add the .bat to the binary path
53+
binaryPath = `${binaryPath}.bat`;
54+
}
55+
56+
57+
58+
2759
exec(binaryPath, (error, stdout, stderr) => {
2860
if (error) {
2961
console.error(`exec error: ${error}`);

0 commit comments

Comments
 (0)