Skip to content

Commit

Permalink
fix: ensure scripts have the executable bit set (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
malept authored Aug 29, 2019
1 parent 4d6a3f4 commit 21e715f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ class DebianInstaller extends common.ElectronInstaller {
const scriptNames = ['preinst', 'postinst', 'prerm', 'postrm']

return common.wrapError('creating script files', async () =>
Promise.all(_.map(this.options.scripts, (item, key) => {
Promise.all(_.map(this.options.scripts, async (item, key) => {
if (scriptNames.includes(key)) {
const scriptFile = path.join(this.stagingDir, 'DEBIAN', key)
this.options.logger(`Creating script file at ${scriptFile}`)

return fs.copy(item, scriptFile)
await fs.copy(item, scriptFile)
return fs.chmod(scriptFile, 0o755)
} else {
throw new Error(`Wrong executable script name: ${key}`)
}
Expand Down
Empty file modified test/fixtures/debian-scripts/preinst.sh
100755 → 100644
Empty file.

0 comments on commit 21e715f

Please sign in to comment.