Skip to content

Commit

Permalink
fix(deb): Can't run generated app due to wrong permission
Browse files Browse the repository at this point in the history
Closes #786
  • Loading branch information
develar committed Oct 2, 2016
1 parent 7a5252c commit c45adca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"tunnel-agent": "^0.4.3",
"update-notifier": "^1.0.2",
"uuid-1345": "^0.99.6",
"yargs": "^5.0.0"
"yargs": "^6.0.0"
},
"optionalDependencies": {
"appdmg-tf": "0.4.9"
Expand All @@ -118,7 +118,7 @@
"ava-tf": "^0.16.0",
"babel-plugin-array-includes": "^2.0.3",
"babel-plugin-transform-es2015-destructuring": "^6.16.0",
"babel-plugin-transform-es2015-parameters": "^6.16.0",
"babel-plugin-transform-es2015-parameters": "^6.17.0",
"babel-plugin-transform-es2015-spread": "^6.8.0",
"decompress-zip": "^0.3.0",
"diff": "^3.0.0",
Expand Down Expand Up @@ -148,8 +148,5 @@
"release": {
"verifyConditions": []
},
"typings": "./out/electron-builder.d.ts",
"publishConfig": {
"tag": "next"
}
"typings": "./out/electron-builder.d.ts"
}
11 changes: 10 additions & 1 deletion src/packager/dirPackager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Promise as BluebirdPromise } from "bluebird"
import { emptyDir, copy } from "fs-extra-p"
import { emptyDir, copy, chmod } from "fs-extra-p"
import { warn } from "../util/log"
import { PlatformPackager } from "../platformPackager"
import { debug7zArgs, spawn } from "../util/util"
Expand Down Expand Up @@ -45,6 +45,15 @@ export async function pack(packager: PlatformPackager<any>, out: string, platfor
await copy(path.resolve(packager.info.projectDir, electronDist, "Electron.app"), path.join(out, "Electron.app"))
}

if (platform === "linux") {
// https://github.com/electron-userland/electron-builder/issues/786
// fix dir permissions — opposite to extract-zip, 7za creates dir with no-access for other users, but dir must be readable for non-root users
await BluebirdPromise.all([
chmod(path.join(out, "locales"), "0755"),
chmod(path.join(out, "resources"), "0755")
])
}

if (platform === "darwin" || platform === "mas") {
await(<any>require("./mac")).createApp(packager, out, initializeApp)
}
Expand Down

0 comments on commit c45adca

Please sign in to comment.