-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathsetupBinaries.js
More file actions
45 lines (39 loc) · 1.18 KB
/
setupBinaries.js
File metadata and controls
45 lines (39 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env node
const os = require("os");
const fs = require("fs");
const path = require("path");
const { download } = require("@nodegui/artifact-installer");
const platform = os.platform();
const outDir = path.resolve(__dirname, "..", "deps");
const linuxDeployQtBinary = path.resolve(outDir, "linuxdeployqt");
function getArtifactsConfig() {
const artifacts = [
{
name: "Linux deploy Qt",
link: `https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage`,
outPath: linuxDeployQtBinary,
postSetup: async () => {
console.log("Setting up permissions for linuxdeployqt");
return fs.chmodSync(linuxDeployQtBinary, 0o755);
}
}
];
return artifacts;
}
async function setupBinaries() {
if (platform !== "linux") {
return console.log(`Nothing extra to setup for ${platform}`);
}
return Promise.all(
getArtifactsConfig().map(async artifact => {
return download(artifact.link, artifact.outPath, {
name: artifact.name,
skipIfExist: true
}).then(artifact.postSetup);
})
);
}
setupBinaries().catch(err => {
console.error(err);
process.exit(1);
});