Skip to content

Commit 6a7bdfd

Browse files
committed
Adding support for making bootstrap executable
1 parent 47dbd17 commit 6a7bdfd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,21 @@ async function main() {
2424
let bootstrap = fs.readFileSync(path.join(`bootstrap`), 'utf8').replace(/{{NODE_VERSION}}/g, version).replace(/{{NODE_VERSION}}/g, version).replace(/{{NODE_RUNNER_FILE}}/g, nodeRunnerFile);
2525
fs.writeFileSync(path.join(`bootstrap`), bootstrap);
2626

27+
try {
28+
await makeExecutable(path.join(`bootstrap`));
29+
} catch (e) {
30+
console.error(e);
31+
throw e;
32+
}
33+
2734
// Download Node.js
2835
try {
2936
await downloadFile(downloadURL, path.join(`node-v${version}-linux-x64.tar.xz`));
3037
await unzip(path.join(`node-v${version}-linux-x64.tar.xz`));
3138
fs.unlinkSync(path.join(`node-v${version}-linux-x64.tar.xz`));
3239
} catch (e) {
3340
console.error(e);
41+
throw e;
3442
}
3543
}
3644
main();
@@ -59,3 +67,7 @@ async function downloadFile(url, path) {
5967
async function unzip(file) {
6068
const { stdout, stderr } = await exec(`tar -xJf ${file}`);
6169
}
70+
71+
async function makeExecutable(file) {
72+
const { stdout, stderr } = await exec(`chmod 755 ${file}`);
73+
}

0 commit comments

Comments
 (0)