Skip to content

Commit dc32d51

Browse files
committed
Add support for updating your gulpfile
You can now run `yo jekyllized:gulp --rsync` to update your gulpfile and package.json to the latest version of both with Rsync for uploading. Neat.
1 parent 85b1a97 commit dc32d51

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ new/updated site is uploaded to your platform of choice.
5959
in
6060
* **Start:** Run `gulp` and watch the magic unfold
6161

62+
#### Update
63+
It's recommended that you keep your `gulpfile` up to date with the generator.
64+
First, update `generator-jekyllized`: `npm update generator-jekyllized -g` and
65+
then run `yo jekyllized:gulp [--rsync|amazon|pages]`, or see the help: `yo
66+
jekyllized:gulp --help`. Note that this will overwrite any local changes you've
67+
made, so make sure to make a backup.
68+
6269
## Usage
6370

6471
#### `gulp [--prod]`

generators/boilerplate/templates/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ If you have cloned this repo or want to reinstall, make sure there's no
2828
`bundle install`.
2929

3030
#### Update
31-
To update: `npm update generator-jekyllized -g`, then run `yo jekyllized:gulp`
32-
in this directory. Note that this will overwrite any local changes, so back it
33-
up.
31+
To update: `npm update generator-jekyllized -g`, then run `yo jekyllized:gulp
32+
[--rsync|amazon|pages]` in this directory. Note that this will overwrite any
33+
local changes, so back it up.
3434

3535
## Github
3636
For more information on how to use your new project, please refer to the [README

generators/gulp/USAGE

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Updating:
2+
When updating your gulpfile and packages you need to include a command line
3+
flag specifying how you want to upload your site, if no flag is specified it
4+
will generate a gulpfile without any uploading task. For example:
5+
6+
yo jekyllized:gulp
7+
yo jekyllized:gulp --rsync
8+
9+
Options:
10+
--amazon
11+
--rsync
12+
--pages

generators/gulp/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
var _ = require('lodash');
44
var generators = require('yeoman-generator');
5+
var argv = require('yargs').argv;
56

67
module.exports = generators.Base.extend({
78
constructor: function () {
@@ -14,6 +15,18 @@ module.exports = generators.Base.extend({
1415
message: 'How do you want to upload your site?',
1516
choices: ['Amazon S3', 'Rsync', 'Github Pages', 'None']
1617
});
18+
19+
if (argv.amazon) {
20+
this.options.uploading = 'Amazon S3';
21+
}
22+
23+
if (argv.rsync) {
24+
this.options.uploading = 'Rsync';
25+
}
26+
27+
if (argv.pages) {
28+
this.options.uploading = 'Github Pages';
29+
}
1730
},
1831

1932
writing: {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"istanbul": "^0.4.2",
4848
"mocha": "^2.4.5",
4949
"mocha-lcov-reporter": "^1.2.0",
50+
"yargs": "^4.6.0",
5051
"yeoman-assert": "^2.1.1",
5152
"yeoman-test": "^1.1.0",
5253
"yo": "^1.7.0"

0 commit comments

Comments
 (0)