package: cross platform "cp" script for windows

This commit is contained in:
jean-emmanuel 2018-10-21 10:07:10 +02:00
parent e70a069bac
commit ef3738ff32
2 changed files with 12 additions and 1 deletions

View file

@ -25,6 +25,7 @@
"babelify": "8.0.0",
"browserify": "16.2.3",
"cardinal-spline-js": "2.3.9",
"cp": "^0.2.0",
"deep-extend": "^0.6.0",
"electron": "1.8.8",
"electron-packager": "12.2.0",
@ -54,7 +55,7 @@
"electron-installer-debian": "1.0.0"
},
"scripts": {
"postinstall": "cp resources/images/logo-nobadge.png app/browser/favicon.png && cp resources/images/logo.png app/browser/logo.png && cd app && npm install",
"postinstall": "node scripts/copy-files.js && cd app && npm install",
"start": "cd app && npm start --",
"build": "npm run build-css && npm run build-js && echo 'JS and CSS assets built. To build the binary package, run \"npm run package\".'",
"package": "npm run build-css && npm run build-launcher-js && npm run build-browser-js -- --prod && node scripts/package.js",

10
scripts/copy-assets.js Normal file
View file

@ -0,0 +1,10 @@
var cp = require('cp'),
path = require('path'),
files = [
['../resources/images/logo-nobadge.png', '../app/browser/favicon.png'],
['../resources/images/logo.png', '../app/browser/logo.png']
]
for (var i in files) {
cp.sync(...files[i].map(f => path.resolve(__dirname + '/' + f)))
}