fix(build): update the gulpfile nightly to only update the distributed package.json file

This commit is contained in:
Josh Thomas
2016-04-14 09:44:58 -05:00
parent e27452b789
commit c1d82f49fc
2 changed files with 11 additions and 3 deletions

View File

@ -864,11 +864,12 @@ gulp.task('publish.nightly', ['build.release'], function(done){
/** /**
* Publishes a new tag to npm with a nightly tag. * Publishes a new tag to npm with a nightly tag.
* This will only update the dist package.json file.
*/ */
gulp.task('nightly', ['package'], function(done) { gulp.task('nightly', ['package'], function(done) {
var fs = require('fs'); var fs = require('fs');
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;
var packageJSON = require('./package.json'); var packageJSON = require('./dist/package.json');
var hashLength = 8; var hashLength = 8;
// Generate a unique hash based on current timestamp // Generate a unique hash based on current timestamp
@ -890,10 +891,9 @@ gulp.task('nightly', ['package'], function(done) {
.concat(createUniqueHash()) .concat(createUniqueHash())
.join('-'); .join('-');
fs.writeFileSync('./package.json', JSON.stringify(packageJSON, null, 2)); fs.writeFileSync('./dist/package.json', JSON.stringify(packageJSON, null, 2));
var npmCmd = spawn('npm', ['publish', '--tag=nightly', './dist']); var npmCmd = spawn('npm', ['publish', '--tag=nightly', './dist']);
npmCmd.stdout.on('data', function (data) { npmCmd.stdout.on('data', function (data) {
console.log(data.toString()); console.log(data.toString());
}); });

View File

@ -42,6 +42,14 @@ From your app directory:
To remove the linked version of `ionic-angular` do `npm rm ionic-angular`, and then reinstall using `npm install ionic-angular`. To remove the linked version of `ionic-angular` do `npm rm ionic-angular`, and then reinstall using `npm install ionic-angular`.
### Publish a nightly release
1. Run `gulp publish.nightly`
- Pulls latest
- builds npm package files into dist
- updates package.json to a nightly version for publish: 0.1.0-beta.0 results in 0.1.0-beta.0-r8e7684t
- publishes to NPM using the nightly tag
2. `npm install ionic-angular@nightly` will now install the latest nightly release
### Running Snapshot ### Running Snapshot