diff --git a/lib/git.js b/lib/git.js index c7dd9b0..6e4c25f 100644 --- a/lib/git.js +++ b/lib/git.js @@ -89,7 +89,7 @@ exports.init = function init(cwd) { exports.clone = function clone(repo, dir, branch, options) { return fse.pathExists(dir).then(exists => { if (exists) { - return Q.resolve(); + return Promise.resolve(); } return fse.ensureDir(path.dirname(path.resolve(dir))).then(() => { const args = ['clone', repo, dir, '--branch', branch, '--single-branch']; @@ -160,7 +160,7 @@ exports.checkout = function checkout(remote, branch, cwd) { return spawn(git, ['checkout', '--orphan', branch], cwd); } // unhandled error - return Q.reject(error); + return Promise.reject(error); } ); }; @@ -195,7 +195,7 @@ exports.commit = function commit(message, cwd) { return spawn(git, ['diff-index', '--quiet', 'HEAD', '.'], cwd) .then(() => { // nothing to commit - return Q.resolve(); + return Promise.resolve(); }) .fail(() => { return spawn(git, ['commit', '-m', message], cwd); diff --git a/tasks/gh-pages.js b/tasks/gh-pages.js index 84b3f59..45b7e9f 100644 --- a/tasks/gh-pages.js +++ b/tasks/gh-pages.js @@ -20,14 +20,14 @@ function getRemoteUrl(dir, remote) { }) .then(() => { if (repo) { - return Q.resolve(repo); + return Promise.resolve(repo); } - return Q.reject( + return Promise.reject( new Error('Failed to get repo URL from options or current directory.') ); }) .fail(err => { - return Q.reject( + return Promise.reject( new Error( 'Failed to get remote.origin.url (task must either be run in a ' + 'git repository with a configured origin remote or must be ' + @@ -39,7 +39,7 @@ function getRemoteUrl(dir, remote) { function getRepo(options) { if (options.repo) { - return Q.resolve(options.repo); + return Promise.resolve(options.repo); } return getRemoteUrl(process.cwd(), 'origin'); } @@ -135,9 +135,9 @@ module.exports = function(grunt) { `but expected "${repoUrl}" in ${options.clone}. ` + 'If you have changed your "repo" option, try ' + 'running `grunt gh-pages-clean` first.'; - return Q.reject(new Error(message)); + return Promise.reject(new Error(message)); } - return Q.resolve(); + return Promise.resolve(); }); }) .then(() => { @@ -158,7 +158,7 @@ module.exports = function(grunt) { log('Removing files'); return git.rm(only.join(' '), options.clone); } - return Q.resolve(); + return Promise.resolve(); }) .then(() => { log('Copying files'); @@ -180,7 +180,7 @@ module.exports = function(grunt) { ); }); } - return Q.resolve(); + return Promise.resolve(); }) .then(() => { log('Committing'); @@ -210,7 +210,7 @@ module.exports = function(grunt) { log('Pushing'); return git.push(options.remote, options.branch, options.clone); } - return Q.resolve(); + return Promise.resolve(); }) .then( () => {