Skip to content

Commit

Permalink
add build.js to improve release
Browse files Browse the repository at this point in the history
  • Loading branch information
xingoxu committed Feb 22, 2017
1 parent 0fb46a0 commit c20107a
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
32 changes: 32 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"use strict";
//build for win32
const path = require('path');
const builder = require("electron-builder");
const distPath = path.resolve(__dirname, './dist/');
const packageJson = require('./package.json');
const productName = packageJson.productName,
version = packageJson.version;
require('shelljs/global');


// Promise is returned
builder.build({
arch: 'ia32',
platform: 'win32',
})
.then(result => {
//改名
mv(path.resolve(distPath, `${productName} Setup ${version}.exe`), path.resolve(distPath, `${productName} Setup ${version}.ia32.exe`));
})
.catch(error => {
console.log(error);
})
.then(() => {
return builder.build({
arch: 'x64',
platform: 'win32',
})
})
.then(result => {
mv(path.resolve(distPath, `${productName} Setup ${version}.exe`), path.resolve(distPath, `${productName} Setup ${version}.x64.exe`));
})
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"license": "MIT",
"devDependencies": {
"electron": "^1.4.1",
"electron-builder": "^13.11.1"
"electron-builder": "^13.11.1",
"shelljs": "^0.7.6"
},
"dependencies": {
"body-parser": "~1.16.0",
Expand All @@ -31,6 +32,12 @@
"appId": "com.xingoxu.ps4helper",
"mac": {
"category": "public.app-category.utilities"
},
"win": {
"target": [
"7z",
"nsis"
]
}
}
}
24 changes: 23 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ getpass@^0.1.1:
dependencies:
assert-plus "^1.0.0"

glob@^7.0.5:
glob@^7.0.0, glob@^7.0.5:
version "7.1.1"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
dependencies:
Expand Down Expand Up @@ -955,6 +955,10 @@ ini@^1.3.4, ini@~1.3.0:
version "1.3.4"
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e"

interpret@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c"

invert-kv@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
Expand Down Expand Up @@ -1547,6 +1551,12 @@ readable-stream@~2.0.0:
string_decoder "~0.10.x"
util-deprecate "~1.0.1"

rechoir@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
dependencies:
resolve "^1.1.6"

redent@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde"
Expand Down Expand Up @@ -1605,6 +1615,10 @@ require-main-filename@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"

resolve@^1.1.6:
version "1.2.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c"

rimraf@^2.2.8:
version "2.6.0"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.0.tgz#89b8a0fe432b9ff9ec9a925a00b6cdb3a91bbada"
Expand Down Expand Up @@ -1666,6 +1680,14 @@ [email protected]:
version "1.0.2"
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.2.tgz#81a552141ec104b88e89ce383103ad5c66564d08"

shelljs@^0.7.6:
version "0.7.6"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad"
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
rechoir "^0.6.2"

signal-exit@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
Expand Down

0 comments on commit c20107a

Please sign in to comment.