Socket
Socket
Sign inDemoInstall

gh-pages

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh-pages - npm Package Compare versions

Comparing version 6.0.0 to 6.1.0

6

bin/gh-pages.js

@@ -54,2 +54,7 @@ #!/usr/bin/env node

.option('-t, --dotfiles', 'Include dotfiles')
.option('--nojekyll', 'Add a .nojekyll file to disable Jekyll')
.option(
'--cname <CNAME>',
'Add a CNAME file with the name of your custom domain'
)
.option('-r, --repo <repo>', 'URL of the repository you are pushing to')

@@ -125,2 +130,3 @@ .option('-p, --depth <depth>', 'depth for clone', ghpages.defaults.depth)

dotfiles: !!options.dotfiles,
nojekyll: !!options.nojekyll,
add: !!options.add,

@@ -127,0 +133,0 @@ remove: options.remove,

@@ -187,2 +187,8 @@ const findCacheDir = require('find-cache-dir');

log('Copying files');
if (options.nojekyll) {
fs.createFileSync(path.join(git.cwd, '.nojekyll'));
}
if (options.cname) {
fs.writeFileSync(path.join(git.cwd, 'CNAME'), options.cname);
}
return copy(files, basePath, path.join(git.cwd, options.dest)).then(

@@ -189,0 +195,0 @@ function () {

4

package.json
{
"name": "gh-pages",
"version": "6.0.0",
"version": "6.1.0",
"description": "Publish to a gh-pages branch on GitHub (or any other branch on any other remote)",

@@ -51,3 +51,3 @@ "keywords": [

"mocha": "^10.2.0",
"sinon": "^15.0.1",
"sinon": "^17.0.1",
"tmp": "^0.2.1"

@@ -54,0 +54,0 @@ },

@@ -131,3 +131,32 @@

#### <a id="optionsnojekyll">options.nojekyll</a>
* type: `boolean`
* default: `false`
Write out a `.nojekyll` file to [bypass Jekyll on GitHub Pages](https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/).
Example use of the `nojekyll` option:
```js
/**
* The usage below will add a `.nojekyll` file to the output.
*/
ghpages.publish('dist', {nojekyll: true}, callback);
```
#### <a id="optionscname">options.cname</a>
* type: `string`
Write out a `CNAME` file with a custom domain name.
Example use of the `cname` option:
```js
/**
* The usage below will add a `CNAME` file to the output.
*/
ghpages.publish('dist', {cname: 'custom-domain.com'}, callback);
```
#### <a id="optionsadd">options.add</a>

@@ -406,6 +435,6 @@ * type: `boolean`

Modify the deployment line to your deploy script if you use custom domain. This will prevent the deployment from removing the domain settings in GitHub.
Use the `--cname` option to create a `CNAME` file with the name of your custom domain. See [the GitHub docs](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site) for more detail.
```
echo your_cutom_domain.online > ./build/CNAME && gh-pages -d build"
gh-pages -d build --cname custom-domain.com"
```

@@ -412,0 +441,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc