From 014b5ccf211915216552ea153374cd01286a90df Mon Sep 17 00:00:00 2001 From: Pete Brousalis Date: Sun, 17 Jul 2016 18:33:13 -0500 Subject: [PATCH] [BUGFIX] add repo back to manifest --- gulpfile.js/lib/manifest.js | 15 +++++++++++++++ gulpfile.js/tasks/release.js | 5 +++++ gulpfile.js/tasks/test.js | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/gulpfile.js/lib/manifest.js b/gulpfile.js/lib/manifest.js index bc8cce7..2897940 100644 --- a/gulpfile.js/lib/manifest.js +++ b/gulpfile.js/lib/manifest.js @@ -2,6 +2,13 @@ var fs = require('fs'); +function repo() { + var manifest = exports.file(); + var repo = manifest.repository && /git@github\.com:([\w-]+)\/([\w-]+)\.git/.exec(manifest.repository.url); + if (!repo) repo = /git\:\/\/github\.com\/([\w-]+)\/([\w-]+)\.git/.exec(manifest.repository.url); + return repo; +} + exports.file = function() { return JSON.parse(fs.readFileSync('./package.json', 'utf8')); } @@ -13,3 +20,11 @@ exports.version = function() { exports.name = function() { return exports.file().name } + +exports.owner = function() { + return repo()[1]; +}; + +exports.repo = function() { + return repo()[2]; +}; diff --git a/gulpfile.js/tasks/release.js b/gulpfile.js/tasks/release.js index e9ed6ab..476c246 100644 --- a/gulpfile.js/tasks/release.js +++ b/gulpfile.js/tasks/release.js @@ -98,6 +98,11 @@ function release(callback) { return; } + if (!manifest.repo()) { + util.errorHandler('release')(new Error('Your package.json is missing the repository field.')); + return; + } + runSequence( 'changelog', 'bump', diff --git a/gulpfile.js/tasks/test.js b/gulpfile.js/tasks/test.js index 28edc73..29e968f 100644 --- a/gulpfile.js/tasks/test.js +++ b/gulpfile.js/tasks/test.js @@ -33,7 +33,7 @@ gulp.task('tdd', function (callback) { gulp.task('webdriver_update', webdriver_update); gulp.task('webdriver_standalone', webdriver_standalone); -gulp.task('e2e', function(callback) { +gulp.task('e2e', ['webdriver_update'], function(callback) { gulp.src(path.join(config.paths.tests, config.paths.e2e, '/**/*.{' + config.extensions.scripts + '}')) .pipe(protractor({ configFile: path.resolve('protractor.conf.js'),