Skip to content

Commit

Permalink
removed release (moved to releaes page); add archive script
Browse files Browse the repository at this point in the history
  • Loading branch information
vutran committed Sep 1, 2016
1 parent d89c656 commit 77a3d8f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"lint": "eslint app",
"build": "webpack",
"package": "node scripts/package.js",
"archive": "node scripts/archive.js",
"dev": "cross-env NODE_ENV=development electron . --debug",
"start": "npm run build && npm run dev"
},
Expand Down
Binary file removed releases/Dext.zip
Binary file not shown.
26 changes: 26 additions & 0 deletions scripts/archive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const path = require('path');
const { exec } = require('child_process');
const chalk = require('chalk');

const archive = filename => new Promise(resolve => {
const basename = path.basename(filename);
exec(`cd dist && mkdir -p releases && cd package && zip -r ../releases/${filename} ${basename}`, err => {
resolve({ err, options: { filename } });
});
});

/**
* Print the status of the archive
*/
const printStatus = ({ err, options }) => {
if (err) {
// eslint-disable-next-line no-console
console.log(chalk.red(`${options.filename} archiving error.`));
} else {
// eslint-disable-next-line no-console
console.log(chalk.green(`${options.filename} archive complete.`));
}
};

// start archiving
archive('Dext-darwin-x64').then(printStatus);
4 changes: 1 addition & 3 deletions scripts/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const chalk = require('chalk');
const DEFAULT_OPTIONS = {
name: 'Dext',
dir: path.resolve(__dirname, '..'),
out: './dist',
out: './dist/package',
asar: true,
overwrite: true,
ignore: [
Expand All @@ -31,8 +31,6 @@ const pkg = (platform, arch) => new Promise(resolve => {

/**
* Print the status of the package
*
* @param {String} err
*/
const printStatus = ({ err, options }) => {
if (err) {
Expand Down

0 comments on commit 77a3d8f

Please sign in to comment.