Skip to content

Commit 8f2d342

Browse files
committed
robo8x [chore] 5/25/2019, 9:52:33 AM
1 parent 4b020c2 commit 8f2d342

File tree

7 files changed

+69
-10
lines changed

7 files changed

+69
-10
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
@license p3x-onenote v2019.4.101
2+
@license p3x-onenote v2019.4.104
33

44
📚 P3X OneNote Linux
55

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313

14-
# 📚 P3X OneNote Linux v2019.4.103
14+
# 📚 P3X OneNote Linux v2019.4.104
1515

1616

1717
🙏 This is an open-source project. Star this repository, if you like it, or even donate to maintain the servers and the development. Thank you so much!
@@ -195,7 +195,7 @@ If you try to build the app with AppImage, you have to change from `electron` `d
195195

196196
---
197197

198-
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.103
198+
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.104
199199

200200
[![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
201201

artifacts/new-language.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
---
1616

17-
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.103
17+
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.104
1818

1919
[![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
2020

artifacts/npm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Though, I am using it, but some distros are different and I only use Linux Mint
2727

2828
---
2929

30-
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.103
30+
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.104
3131

3232
[![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
3333

changelog.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
## Change log
99

10+
### v2019.4.104
11+
* CHORE: Upgraded to Electron v5
12+
* BUGFIX: Electron was not working sandbox, I worked it out with a script in `src/after-pack.js`
13+
1014
### v2019.4.101
1115
* BUGFIX: Minor translation issue.
1216

@@ -76,7 +80,7 @@ FEATURE: for all links in P3X OneNote is left for the user to decide how the lin
7680

7781
---
7882

79-
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.103
83+
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.104
8084

8185
[![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
8286

package.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "p3x-onenote",
3-
"version": "2019.4.103",
3+
"version": "2019.4.104",
44
"description": "📚 P3X OneNote Linux",
55
"main": "src/electron/app.js",
66
"corifeus": {
@@ -53,18 +53,20 @@
5353
"opencollective": "^1.0.3",
5454
"semver": "^6.1.0",
5555
"typeface-roboto": "0.0.54",
56-
"electron": "=4.2.1"
56+
"electron": "=5.0.2"
5757
},
5858
"devDependencies": {
59+
"fs-extra": "^8.0.1",
5960
"jsdom": "^15.1.0",
6061
"angular-mocks": "^1.7.8",
6162
"corifeus-builder": "^2019.4.101",
62-
"electron-builder": "^20.40.2"
63+
"electron-builder": "^20.41.0"
6364
},
6465
"engines": {
6566
"node": ">=10.13.0"
6667
},
6768
"build": {
69+
"afterPack": "./src/after-pack.js",
6870
"publish": [
6971
{
7072
"provider": "github",
@@ -87,4 +89,4 @@
8789
"type": "opencollective",
8890
"url": "https://opencollective.com/p3x-onenote"
8991
}
90-
}
92+
}

src/after-pack.js

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
const fs = require('fs-extra')
2+
const pkg = require('../package')
3+
const { spawn } = require('child_process')
4+
const { chdir } = require('process')
5+
6+
const exec = async function exec(cmd, args = []) {
7+
const child = spawn(cmd, args, { shell: true })
8+
redirectOutputFor(child)
9+
await waitFor(child)
10+
}
11+
12+
const redirectOutputFor = (child) => {
13+
const printStdout = (data) => {
14+
process.stdout.write(data.toString())
15+
}
16+
const printStderr = (data) => {
17+
process.stderr.write(data.toString())
18+
}
19+
child.stdout.on('data', printStdout)
20+
child.stderr.on('data', printStderr)
21+
22+
child.once('close', () => {
23+
child.stdout.off('data', printStdout)
24+
child.stderr.off('data', printStderr)
25+
})
26+
}
27+
28+
const waitFor = async function(child) {
29+
return new Promise((resolve) => {
30+
child.once('close', () => resolve())
31+
})
32+
}
33+
34+
module.exports = async function(context) {
35+
//console.log(context)
36+
console.warn('p3x disable sandbox')
37+
const isLinux = context.targets.find(target => target.name === 'appImage' || target.name === 'snap')
38+
if (!isLinux) {
39+
return
40+
}
41+
const originalDir = process.cwd()
42+
const dirname = context.appOutDir
43+
chdir(dirname)
44+
45+
await exec('mv', [pkg.name, pkg.name + '.bin'])
46+
const wrapperScript = `#!/bin/bash
47+
"\${BASH_SOURCE%/*}"/${pkg.name}.bin "$@" --no-sandbox
48+
`
49+
fs.writeFileSync(pkg.name, wrapperScript)
50+
await exec('chmod', ['+x', pkg.name])
51+
52+
chdir(originalDir)
53+
}

0 commit comments

Comments
 (0)