Skip to content

Commit

Permalink
Add read permission to the downloaded jq binary (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
huan authored Nov 15, 2021
1 parent 23d17d3 commit 3f11634
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/install-binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ if (platform in DOWNLOAD_MAP) {
const distPath = path.join(OUTPUT_DIR, JQ_NAME)
fs.renameSync(path.join(OUTPUT_DIR, filename), distPath)
if (fileExist(distPath)) {
fs.chmodSync(distPath, fs.constants.S_IXUSR || 0o100)
// fs.chmodSync(distPath, fs.constants.S_IXUSR || 0o100)
// Huan(202111): we need the read permission so that the build system can pack the node_modules/ folder,
// i.e. build with Heroku CI/CD, docker build, etc.
// @see https://www.gnu.org/software/libc/manual/html_node/Permission-Bits.html
fs.chmodSync(distPath,
(fs.constants.S_IXUSR | fs.constants.S_IREAD | fs.constants.S_IROTH | fs.constants.S_IRGRP) ||
0o100 | 0o400 | 0o040 | 0o004)
}
console.log(`Downloaded in ${OUTPUT_DIR}`)
})
Expand Down

0 comments on commit 3f11634

Please sign in to comment.