Fix build
This commit is contained in:
parent
2b682125bb
commit
d3576b6eb6
22
Gruntfile.js
22
Gruntfile.js
|
@ -1,5 +1,4 @@
|
||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var version = grunt.option('release');
|
var version = grunt.option('release');
|
||||||
|
|
||||||
|
@ -182,7 +181,7 @@ module.exports = function(grunt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
grunt.registerTask('default', 'Build OpenPGP.js', function() {
|
grunt.registerTask('default', 'Build OpenPGP.js', function() {
|
||||||
grunt.task.run(['clean', 'copy:zlib', 'browserify', 'replace', 'uglify']);
|
grunt.task.run(['clean', 'copy:zlib', 'browserify', 'replace', 'uglify', 'npm_pack']);
|
||||||
//TODO jshint is not run because of too many discovered issues, once these are addressed it should autorun
|
//TODO jshint is not run because of too many discovered issues, once these are addressed it should autorun
|
||||||
grunt.log.ok('Before Submitting a Pull Request please also run `grunt jshint`.');
|
grunt.log.ok('Before Submitting a Pull Request please also run `grunt jshint`.');
|
||||||
});
|
});
|
||||||
|
@ -199,6 +198,25 @@ module.exports = function(grunt) {
|
||||||
mocha.stderr.pipe(process.stderr);
|
mocha.stderr.pipe(process.stderr);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Alias the `npm_pack` task to run `npm pack`
|
||||||
|
grunt.registerTask('npm_pack', 'npm pack', function () {
|
||||||
|
var done = this.async();
|
||||||
|
var npm = require('child_process').exec('npm pack ../', { cwd: 'dist'}, function (err, stdout) {
|
||||||
|
var package = stdout;
|
||||||
|
if (err === null) {
|
||||||
|
var install = require('child_process').exec('npm install dist/' + package, function (err) {
|
||||||
|
done(err);
|
||||||
|
});
|
||||||
|
install.stdout.pipe(process.stdout);
|
||||||
|
install.stderr.pipe(process.stderr);
|
||||||
|
} else {
|
||||||
|
done(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
npm.stdout.pipe(process.stdout);
|
||||||
|
npm.stderr.pipe(process.stderr);
|
||||||
|
});
|
||||||
|
|
||||||
// Test/Dev tasks
|
// Test/Dev tasks
|
||||||
grunt.registerTask('test', ['copy:npm', 'mochaTest', 'mocha_phantomjs']);
|
grunt.registerTask('test', ['copy:npm', 'mochaTest', 'mocha_phantomjs']);
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,7 @@ grunt set_version --release=$1
|
||||||
npm test
|
npm test
|
||||||
|
|
||||||
# Add build files to git
|
# Add build files to git
|
||||||
sed -i "" '/dist/d' .gitignore
|
sed -i "" '/^dist\/$/d' .gitignore
|
||||||
git add dist/ *.json
|
git add dist/ *.json
|
||||||
git commit -m "Release new version"
|
git commit -m "Release new version"
|
||||||
git checkout .gitignore
|
git checkout .gitignore
|
||||||
|
|
Loading…
Reference in New Issue
Block a user