Compare commits

...
This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.

18 commits

Author SHA1 Message Date
Ray Schamp
1be63c5ea9 Merge branch 'master' into pr/71 2017-03-10 15:08:08 -05:00
Tim Schaub
e0f90a8ec2 Merge pull request from mandeldl/patch-1
Fix small typo
2016-12-01 23:09:29 -08:00
David Mandel
9ac60dfea7 fix small typoe 2016-12-01 10:21:04 -05:00
Tim Schaub
c6cd05dde5 0.12.0 2016-11-16 18:17:32 -07:00
Tim Schaub
ffc8d6acf5 Log changes 2016-11-16 18:17:26 -07:00
Tim Schaub
33815e4cb1 Merge pull request from tschaub/updates
Updates dependencies
2016-11-16 18:14:07 -07:00
Tim Schaub
b7e8779c41 Merge pull request from sobolevn/patch-1
Updated readme.md with svg image
2016-11-16 18:11:46 -07:00
Tim Schaub
f8a7f4cf11 Update dependencies 2016-11-16 18:11:06 -07:00
Tim Schaub
b424c0fdea Test on Node 6 and cache dependencies 2016-11-16 18:10:37 -07:00
Tim Schaub
7bc6da9277 Update dev dependencies 2016-11-16 18:10:37 -07:00
Tim Schaub
49e48a457a Unindent 2016-11-16 18:10:37 -07:00
Tim Schaub
ab5c4e570c Merge pull request from tschaub/greenkeeper-globby-6.1.0
Update globby to version 6.1.0 🚀
2016-11-16 18:07:37 -07:00
greenkeeperio-bot
fd9e5cf38f chore(package): update globby to version 6.1.0
https://greenkeeper.io/
2016-11-04 02:11:09 -06:00
Sobolev Nikita
d1dbe48527 Updated readme.md with svg image 2016-10-25 09:01:21 +03:00
Ray Schamp
15d8918ec2 Merge branch 'master' of https://github.com/rschamp/gh-pages into pr/71
# Conflicts:
#	package.json
2016-10-19 22:23:18 -04:00
Thiago Felix
4d42d83915 Merge branch 'master' into master 2016-05-14 20:14:53 -03:00
Thiago Felix
00d61946f2 Merge branch 'master' into master 2016-04-22 14:12:35 -03:00
Thiago Felix
1c5e804817 Fix noPush command argument and include regression tests for the
gh-pages cli

fixes 
2016-04-05 09:55:46 -03:00
8 changed files with 124 additions and 14 deletions

View file

@ -1,6 +1,10 @@
language: node_js
node_js:
- "4"
- "6"
cache:
directories:
- node_modules
branches:
only:

View file

@ -40,7 +40,7 @@ ghpages.publish(path.join(process.cwd(), program.dist), {
add: !!program.add,
only: program.remove,
remote: program.remote,
push: !program.noPush,
push: !!program.push,
logger: function(message) {
process.stderr.write(message + '\n');
}

View file

@ -1,3 +1,23 @@
## v0.12.0
* [#146](https://github.com/tschaub/gh-pages/pull/146) - Updates dependencies ([@tschaub](https://github.com/tschaub))
* [#138](https://github.com/tschaub/gh-pages/pull/138) - Updated readme.md with svg image ([@sobolevn](https://github.com/sobolevn))
* [#142](https://github.com/tschaub/gh-pages/pull/142) - Update globby to version 6.1.0 🚀 ([@tschaub](https://github.com/tschaub))
* [#134](https://github.com/tschaub/gh-pages/pull/134) - Update eslint to version 3.8.0 🚀 ([@tschaub](https://github.com/tschaub))
* [#135](https://github.com/tschaub/gh-pages/pull/135) - Update async to version 2.1.2 🚀 ([@tschaub](https://github.com/tschaub))
* [#130](https://github.com/tschaub/gh-pages/pull/130) - Update mocha to version 3.1.1 🚀 ([@tschaub](https://github.com/tschaub))
* [#112](https://github.com/tschaub/gh-pages/pull/112) - Update graceful-fs to version 4.1.6 🚀 ([@tschaub](https://github.com/tschaub))
* [#106](https://github.com/tschaub/gh-pages/pull/106) - Add a --tag option to the cli ([@donavon](https://github.com/donavon))
* [#102](https://github.com/tschaub/gh-pages/pull/102) - Update graceful-fs to version 4.1.5 🚀 ([@tschaub](https://github.com/tschaub))
* [#89](https://github.com/tschaub/gh-pages/pull/89) - Update globby to version 5.0.0 🚀 ([@tschaub](https://github.com/tschaub))
* [#87](https://github.com/tschaub/gh-pages/pull/87) - Update eslint-config-tschaub to version 5.0.0 🚀 ([@tschaub](https://github.com/tschaub))
* [#78](https://github.com/tschaub/gh-pages/pull/78) - Use rimraf for cleaning ([@tschaub](https://github.com/tschaub))
* [#75](https://github.com/tschaub/gh-pages/pull/75) - Expose a "remove" option to the CLI ([@tschaub](https://github.com/tschaub))
* [#76](https://github.com/tschaub/gh-pages/pull/76) - Update eslint to version 2.8.0 🚀 ([@tschaub](https://github.com/tschaub))
* [#70](https://github.com/tschaub/gh-pages/pull/70) - Update eslint to version 2.7.0 🚀 ([@tschaub](https://github.com/tschaub))
* [#63](https://github.com/tschaub/gh-pages/pull/63) - Update eslint to version 2.4.0 🚀 ([@tschaub](https://github.com/tschaub))
* [#62](https://github.com/tschaub/gh-pages/pull/62) - Update eslint to version 2.3.0 🚀 ([@tschaub](https://github.com/tschaub))
## v0.11.0
* [#61](https://github.com/tschaub/gh-pages/pull/61) - Support a custom remote. ([@marco-c](https://github.com/marco-c))

View file

@ -99,8 +99,7 @@ exports.clone = function clone(repo, dir, branch, options) {
return Q.resolve();
} else {
return fs.makeTree(path.dirname(path.resolve(dir))).then(function() {
var args = ['clone', repo, dir, '--branch', branch, '--single-branch',
'--origin', options.remote];
var args = ['clone', repo, dir, '--branch', branch, '--single-branch', '--origin', options.remote];
if (options.depth) {
args.push('--depth', options.depth);
}

View file

@ -1,6 +1,6 @@
{
"name": "gh-pages",
"version": "0.11.0",
"version": "0.12.0",
"description": "Publish to a gh-pages branch on GitHub (or any other branch on any other remote)",
"keywords": [
"git",
@ -28,17 +28,18 @@
"dependencies": {
"async": "2.1.2",
"commander": "2.9.0",
"globby": "^5.0.0",
"graceful-fs": "4.1.6",
"globby": "^6.1.0",
"graceful-fs": "4.1.10",
"q": "1.4.1",
"q-io": "1.13.2",
"rimraf": "^2.5.2"
"rimraf": "^2.5.4"
},
"devDependencies": {
"chai": "^3.4.1",
"eslint": "3.8.0",
"eslint-config-tschaub": "5.0.0",
"mocha": "^3.1.1"
"chai": "^3.5.0",
"eslint": "^3.10.2",
"eslint-config-tschaub": "^6.0.0",
"mocha": "^3.1.2",
"sinon": "^1.17.3"
},
"bin": {
"gh-pages": "bin/gh-pages"

View file

@ -64,7 +64,7 @@ ghpages.publish(path.join(__dirname, 'build'), callback);
### Options
The default options work for simple cases cases. The options described below let you push to alternate branches, customize your commit messages, and more.
The default options work for simple cases. The options described below let you push to alternate branches, customize your commit messages, and more.
#### <a id="optionssrc">options.src</a>
@ -321,4 +321,4 @@ npm run deploy
Note that this plugin requires Git 1.7.6 or higher (because it uses the `--exit-code` option for `git ls-remote`). If you'd like to see this working with earlier versions of Git, please [open an issue](https://github.com/tschaub/gh-pages/issues).
[![Current Status](https://secure.travis-ci.org/tschaub/gh-pages.png?branch=master)](https://travis-ci.org/tschaub/gh-pages)
[![Current Status](https://secure.travis-ci.org/tschaub/gh-pages.svg?branch=master)](https://travis-ci.org/tschaub/gh-pages)

53
test/bin/gh-pages.spec.js Normal file
View file

@ -0,0 +1,53 @@
/* eslint-env mocha */
var ghpages = require('../../lib/index');
var stub = require('../helper').stub;
var assert = require('../helper').sinon.assert;
var cli = '../../bin/gh-pages'
describe('gh-pages', function() {
beforeEach(function() {
stub(ghpages, 'publish')
})
afterEach(function() {
ghpages.publish.restore()
})
var publish = function(dist, args) {
process.argv = ['node', 'gh-pages', '-d', dist].concat(args)
require(cli);
delete require.cache[require.resolve(cli)]
}
var defaults = {
repo: undefined,
silent: false,
branch: 'gh-pages',
src: '**/*',
message: 'Updates',
dotfiles: false,
add: false,
remote: 'origin',
push: true
}
var scenarions = [
['-d lib', defaults],
['-d lib -n', {push: false}],
['-d lib -x', {silent: true}],
['-d lib -t', {dotfiles: true}],
['-d lib -a', {add: true}]
]
scenarions.forEach(function(scenario) {
var args = scenario[0].split(' ')
var config = scenario[1]
var dist = args[1]
it(args.join(' '), function() {
publish(dist, args)
assert.calledWithMatch(ghpages.publish, dist, config);
})
})
});

View file

@ -1,4 +1,5 @@
var chai = require('chai');
var sinon = require('sinon');
/** @type {boolean} */
@ -10,3 +11,35 @@ chai.config.includeStack = true;
* @type {function}
*/
exports.assert = chai.assert;
/**
* Sinon's spy function
* @type {function}
*/
exports.spy = sinon.spy
/**
* Sinon's stub function
* @type {function}
*/
exports.stub = sinon.stub
/**
* Sinon's mock function
* @type {function}
*/
exports.mock = sinon.mock
/**
* Sinon's API object
* @type {object}
*/
exports.sinon = sinon
/**
* Turn of maxListeners warning during the tests
* See: https://nodejs.org/docs/latest/api/events.html#events_emitter_setmaxlisteners_n
*/
require('events').EventEmitter.prototype._maxListeners = 0;