Comparing version 1.0.0-beta.1 to 1.0.0
{ | ||
"name": "gh-pages", | ||
"version": "1.0.0-beta.1", | ||
"version": "1.0.0", | ||
"description": "Publish to a gh-pages branch on GitHub (or any other branch on any other remote)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
114
readme.md
# gh-pages | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/tschaub/gh-pages.svg)](https://greenkeeper.io/) | ||
Publish files to a `gh-pages` branch on GitHub (or any other branch anywhere else). | ||
@@ -21,3 +19,3 @@ | ||
ghpages.publish(path.join(__dirname, 'dist'), function(err) { ... }); | ||
ghpages.publish('dist', function(err) {}); | ||
``` | ||
@@ -29,5 +27,5 @@ | ||
```js | ||
ghpages.publish(basePath, callback); | ||
ghpages.publish(dir, callback); | ||
// or... | ||
ghpages.publish(basePath, options, callback); | ||
ghpages.publish(dir, options, callback); | ||
``` | ||
@@ -42,3 +40,3 @@ | ||
### <a id="basepath">`basePath`</a> | ||
### <a id="dir">`dir`</a> | ||
* type: `string` | ||
@@ -48,3 +46,3 @@ | ||
Example use of the `basePath`: | ||
Example use: | ||
@@ -55,3 +53,3 @@ ```js | ||
* | ||
* build/ | ||
* dist/ | ||
* index.html | ||
@@ -68,3 +66,3 @@ * js/ | ||
*/ | ||
ghpages.publish(path.join(__dirname, 'build'), callback); | ||
ghpages.publish('dist', callback); | ||
``` | ||
@@ -85,2 +83,39 @@ | ||
#### <a id="optionsbranch">options.branch</a> | ||
* type: `string` | ||
* default: `'gh-pages'` | ||
The name of the branch you'll be pushing to. The default uses GitHub's `gh-pages` branch, but this can be configured to push to any branch on any remote. | ||
Example use of the `branch` option: | ||
```js | ||
/** | ||
* This task pushes to the `master` branch of the configured `repo`. | ||
*/ | ||
ghpages.publish('dist', { | ||
branch: 'master', | ||
repo: 'https://example.com/other/repo.git' | ||
}, callback); | ||
``` | ||
#### <a id="optionsdest">options.dest</a> | ||
* type: `string` | ||
* default: `'.'` | ||
The destination folder within the destination branch. By default, all files are published to the root of the repository. | ||
Example use of the `dest` option: | ||
```js | ||
/** | ||
* Place content in the static/project subdirectory of the target | ||
* branch. | ||
*/ | ||
ghpages.publish('dist', { | ||
dest: 'static/project' | ||
}, callback); | ||
``` | ||
#### <a id="optionsdotfiles">options.dotfiles</a> | ||
@@ -99,3 +134,3 @@ * type: `boolean` | ||
*/ | ||
ghpages.publish(path.join(__dirname, 'dist'), { dotfiles: true }, callback); | ||
ghpages.publish('dist', {dotfiles: true}, callback); | ||
``` | ||
@@ -117,3 +152,3 @@ | ||
*/ | ||
ghpages.publish(path.join(__dirname, 'build'), { add: true }, callback); | ||
ghpages.publish('dist', {add: true}, callback); | ||
``` | ||
@@ -138,3 +173,3 @@ | ||
*/ | ||
ghpages.publish(path.join(__dirname, 'build'), { | ||
ghpages.publish('dist', { | ||
repo: 'https://example.com/other/repo.git' | ||
@@ -145,21 +180,2 @@ }, callback); | ||
#### <a id="optionsbranch">options.branch</a> | ||
* type: `string` | ||
* default: `'gh-pages'` | ||
The name of the branch you'll be pushing to. The default uses GitHub's `gh-pages` branch, but this can be configured to push to any branch on any remote. | ||
Example use of the `branch` option: | ||
```js | ||
/** | ||
* This task pushes to the `master` branch of the configured `repo`. | ||
*/ | ||
ghpages.publish(path.join(__dirname, 'build'), { | ||
branch: 'master', | ||
repo: 'https://example.com/other/repo.git' | ||
}, callback); | ||
``` | ||
#### <a id="optionsremote">options.remote</a> | ||
@@ -177,3 +193,3 @@ * type: `string` | ||
*/ | ||
ghpages.publish(path.join(__dirname, 'build'), { | ||
ghpages.publish('dist', { | ||
remote: 'upstream' | ||
@@ -203,3 +219,3 @@ }, callback); | ||
*/ | ||
ghpages.publish(path.join(__dirname, 'build'), { | ||
ghpages.publish('dist', { | ||
message: 'Auto-generated commit' | ||
@@ -219,3 +235,3 @@ }, callback); | ||
```js | ||
ghpages.publish(path.join(__dirname, 'build'), { | ||
ghpages.publish('dist', { | ||
user: { | ||
@@ -243,3 +259,3 @@ name: 'Joe Code', | ||
*/ | ||
ghpages.publish(path.join(__dirname, 'build'), { | ||
ghpages.publish('dist', { | ||
clone: 'path/to/tmp/dir' | ||
@@ -259,3 +275,3 @@ }, callback); | ||
```js | ||
ghpages.publish(path.join(__dirname, 'build'), { push: false }, callback); | ||
ghpages.publish('dist', {push: false}, callback); | ||
``` | ||
@@ -268,3 +284,3 @@ | ||
Suppress logging. This option should be used if the repository URL or other information passed to git commands is sensitive and should not be logged. With silent `true` log messages are suppressed and error messages are sanitized. | ||
Avoid showing repository URLs or other information in errors. | ||
@@ -275,5 +291,5 @@ Example use of the `silent` option: | ||
/** | ||
* This configuration will suppress logging and sanitize error messages. | ||
* This configuration will avoid logging the GH_TOKEN if there is an error. | ||
*/ | ||
ghpages.publish(path.join(__dirname, 'build'), { | ||
ghpages.publish('dist', { | ||
repo: 'https://' + process.env.GH_TOKEN + '@github.com/user/private-repo.git', | ||
@@ -297,3 +313,3 @@ silent: true | ||
*/ | ||
ghpages.publish(path.join(__dirname, 'build'), { | ||
ghpages.publish('dist', { | ||
git: '/path/to/git' | ||
@@ -303,20 +319,2 @@ }, callback); | ||
#### <a id="optionsdest">options.dest</a> | ||
* type: `string` | ||
* default: `'.'` | ||
The destination folder within the destination branch/repository. | ||
Example use of the `dest` option: | ||
```js | ||
/** | ||
* Place content in the static/project subdirectory of the target | ||
* branch/repository. If removing files, only remove static/project. | ||
*/ | ||
ghpages.publish(path.join(__dirname, 'build'), { | ||
dest: 'static/project' | ||
}, callback); | ||
``` | ||
## Command Line Utility | ||
@@ -323,0 +321,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
47651
331