Skip to content

Commit 388044a

Browse files
committed
refactor: Remove cname & nojekyll settings and update name gh-pages to pl-pages
1 parent 96124af commit 388044a

21 files changed

+2331
-3719
lines changed

bin/gh-pages-clean.js bin/pl-pages-clean.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env node
22

3-
const ghpages = require('../lib/index.js');
3+
const plpages = require('../lib/index.js');
44

55
function main() {
6-
ghpages.clean();
6+
plpages.clean();
77
}
88

99
if (require.main === module) {

bin/gh-pages.js bin/pl-pages.js

+10-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
const ghpages = require('../lib/index.js');
3+
const plpages = require('../lib/index.js');
44
const {Command} = require('commander');
55
const path = require('path');
66
const pkg = require('../package.json');
@@ -9,7 +9,7 @@ const addr = require('email-addresses');
99
function publish(dist, config) {
1010
return new Promise((resolve, reject) => {
1111
const basePath = path.resolve(process.cwd(), dist);
12-
ghpages.publish(basePath, config, (err) => {
12+
plpages.publish(basePath, config, (err) => {
1313
if (err) {
1414
return reject(err);
1515
}
@@ -29,39 +29,34 @@ function main(args) {
2929
.option(
3030
'-s, --src <src>',
3131
'Pattern used to select which files to publish',
32-
ghpages.defaults.src
32+
plpages.defaults.src
3333
)
3434
.option(
3535
'-b, --branch <branch>',
3636
'Name of the branch you are pushing to',
37-
ghpages.defaults.branch
37+
plpages.defaults.branch
3838
)
3939
.option(
4040
'-e, --dest <dest>',
4141
'Target directory within the destination branch (relative to the root)',
42-
ghpages.defaults.dest
42+
plpages.defaults.dest
4343
)
4444
.option('-a, --add', 'Only add, and never remove existing files')
4545
.option('-x, --silent', 'Do not output the repository url')
4646
.option(
4747
'-m, --message <message>',
4848
'commit message',
49-
ghpages.defaults.message
49+
plpages.defaults.message
5050
)
5151
.option('-g, --tag <tag>', 'add tag to commit')
52-
.option('--git <git>', 'Path to git executable', ghpages.defaults.git)
52+
.option('--git <git>', 'Path to git executable', plpages.defaults.git)
5353
.option('-t, --dotfiles', 'Include dotfiles')
54-
.option('--nojekyll', 'Add a .nojekyll file to disable Jekyll')
55-
.option(
56-
'--cname <CNAME>',
57-
'Add a CNAME file with the name of your custom domain'
58-
)
5954
.option('-r, --repo <repo>', 'URL of the repository you are pushing to')
60-
.option('-p, --depth <depth>', 'depth for clone', ghpages.defaults.depth)
55+
.option('-p, --depth <depth>', 'depth for clone', plpages.defaults.depth)
6156
.option(
6257
'-o, --remote <name>',
6358
'The name of the remote',
64-
ghpages.defaults.remote
59+
plpages.defaults.remote
6560
)
6661
.option(
6762
'-u, --user <address>',
@@ -71,7 +66,7 @@ function main(args) {
7166
'-v, --remove <pattern>',
7267
'Remove files that match the given pattern ' +
7368
'(ignored if used together with --add).',
74-
ghpages.defaults.remove
69+
plpages.defaults.remove
7570
)
7671
.option('-n, --no-push', 'Commit only (with no push)')
7772
.option(
@@ -126,7 +121,6 @@ function main(args) {
126121
git: options.git,
127122
depth: options.depth,
128123
dotfiles: !!options.dotfiles,
129-
nojekyll: !!options.nojekyll,
130124
add: !!options.add,
131125
remove: options.remove,
132126
remote: options.remote,

changelog.md

-269
Large diffs are not rendered by default.

lib/index.js

+5-11
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ const globby = require('globby');
88
const path = require('path');
99
const util = require('util');
1010

11-
const log = util.debuglog('gh-pages');
11+
const log = util.debuglog('pl-pages');
1212

1313
/**
1414
* Get the cache directory.
1515
* @param {string} [optPath] Optional path.
1616
* @return {string} The full path to the cache directory.
1717
*/
1818
function getCacheDir(optPath) {
19-
const dir = findCacheDir({name: 'gh-pages'});
19+
const dir = findCacheDir({name: 'pl-pages'});
2020
if (!optPath) {
2121
return dir;
2222
}
@@ -40,7 +40,7 @@ exports.defaults = {
4040
git: 'git',
4141
depth: 1,
4242
dotfiles: false,
43-
branch: 'gh-pages',
43+
branch: 'pl-pages',
4444
remote: 'origin',
4545
src: '**/*',
4646
remove: '.',
@@ -51,7 +51,7 @@ exports.defaults = {
5151
};
5252

5353
/**
54-
* Push a git branch to a remote (pushes gh-pages by default).
54+
* Push a git branch to a remote (pushes pl-pages by default).
5555
* @param {string} basePath The base path.
5656
* @param {object} config Publish options.
5757
* @param {Function} callback Callback.
@@ -139,7 +139,7 @@ exports.publish = function publish(basePath, config, callback) {
139139
repoUrl +
140140
'" in ' +
141141
git.cwd +
142-
'. Try running the `gh-pages-clean` script first.';
142+
'. Try running the `pl-pages-clean` script first.';
143143
throw new Error(message);
144144
}
145145
return git;
@@ -184,12 +184,6 @@ exports.publish = function publish(basePath, config, callback) {
184184
})
185185
.then((git) => {
186186
log('Copying files');
187-
if (options.nojekyll) {
188-
fs.createFileSync(path.join(git.cwd, '.nojekyll'));
189-
}
190-
if (options.cname) {
191-
fs.writeFileSync(path.join(git.cwd, 'CNAME'), options.cname);
192-
}
193187
return copy(files, basePath, path.join(git.cwd, options.dest)).then(
194188
function () {
195189
return git;

0 commit comments

Comments
 (0)