Skip to content

Commit

Permalink
Add support for updating your gulpfile
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sondr3 committed Apr 14, 2016
1 parent 85b1a97 commit dc32d51
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ new/updated site is uploaded to your platform of choice.
in
* **Start:** Run `gulp` and watch the magic unfold

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

## Usage

#### `gulp [--prod]`
Expand Down
6 changes: 3 additions & 3 deletions generators/boilerplate/templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ If you have cloned this repo or want to reinstall, make sure there's no
`bundle install`.

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

## Github
For more information on how to use your new project, please refer to the [README
Expand Down
12 changes: 12 additions & 0 deletions generators/gulp/USAGE
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Updating:
When updating your gulpfile and packages you need to include a command line
flag specifying how you want to upload your site, if no flag is specified it
will generate a gulpfile without any uploading task. For example:

yo jekyllized:gulp
yo jekyllized:gulp --rsync

Options:
--amazon
--rsync
--pages
13 changes: 13 additions & 0 deletions generators/gulp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var _ = require('lodash');
var generators = require('yeoman-generator');
var argv = require('yargs').argv;

module.exports = generators.Base.extend({
constructor: function () {
Expand All @@ -14,6 +15,18 @@ module.exports = generators.Base.extend({
message: 'How do you want to upload your site?',
choices: ['Amazon S3', 'Rsync', 'Github Pages', 'None']
});

if (argv.amazon) {
this.options.uploading = 'Amazon S3';
}

if (argv.rsync) {
this.options.uploading = 'Rsync';
}

if (argv.pages) {
this.options.uploading = 'Github Pages';
}
},

writing: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"istanbul": "^0.4.2",
"mocha": "^2.4.5",
"mocha-lcov-reporter": "^1.2.0",
"yargs": "^4.6.0",
"yeoman-assert": "^2.1.1",
"yeoman-test": "^1.1.0",
"yo": "^1.7.0"
Expand Down

0 comments on commit dc32d51

Please sign in to comment.