Skip to content

Commit 1f9adfa

Browse files
committed
Add initial windows-store script
1 parent 03626e2 commit 1f9adfa

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"pack-linux": "electron-packager . --asar --overwrite --platform=linux --arch=x64 --icon=assets/app-icon/png/64.png --prune=true --out=out",
1818
"package": "npm run pack-mac && npm run pack-win && npm run pack-linux",
1919
"installer": "node ./script/installer.js",
20+
"windows-store": "node ./script/windows-store.js",
2021
"prepare-release": "npm run package && npm run sign-exe && npm run installer && npm run sign-installer",
2122
"release": "node ./script/release.js"
2223
},

script/windows-store.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const ChildProcess = require('child_process')
2+
const path = require('path')
3+
4+
const version = require('../package').version
5+
6+
const command = path.join(__dirname, '..', 'node_modules', '.bin', 'electron-windows-store.cmd')
7+
const args = [
8+
'--input-directory',
9+
path.join(__dirname, '..', 'ElectronAPIDemos-win32-ia32'),
10+
'--output-directory',
11+
path.join(__dirname, '..', 'windows-store'),
12+
'--flatten',
13+
true,
14+
'--package-version',
15+
version,
16+
'--package-name',
17+
'ElectronAPIDemos'
18+
]
19+
20+
const windowsStore = ChildProcess.spawn(command, args, {stdio: 'inherit'})
21+
windowsStore.on('close', (code) => {
22+
process.exit(code)
23+
})

0 commit comments

Comments
 (0)