Skip to content

Commit

Permalink
add .nojekyll option, closes #19
Browse files Browse the repository at this point in the history
  • Loading branch information
notslang committed May 3, 2014
1 parent 8763c7b commit d313492
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/deployers/gh-pages/index.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
path = require 'path'
fs = require 'fs'
shell = require 'shelljs/global'
touch = require('touch').sync
readdirp = require 'readdirp'
W = require 'when'

Expand All @@ -25,6 +26,11 @@ class Github extends Deployer
type: 'string'
required: true
default: 'gh-pages'
@config.schema.nojekyll =
type: 'boolean'
required: true
default: false
description: 'add a `.nojekyll` file to bypass Jekyll processing'

deploy: (config) ->
super(config)
Expand All @@ -34,6 +40,7 @@ class Github extends Deployer
@switchToDeployBranch(config.branch)
@removeExtraneousFiles(config.sourceDir).then( =>
@dumpSourceDirToRoot(config.sourceDir, config.projectRoot)
@nojekyllOption(config.nojekyll, config.projectRoot)
@makeCommit()
@pushCode(config.branch, originalBranch)
)
Expand Down Expand Up @@ -88,6 +95,9 @@ class Github extends Deployer
mv '-f', path.resolve(sourceDir), root
rm '-rf', sourceDir

nojekyllOption: (makeNojekyllFile, root) ->
if makeNojekyllFile then touch path.join(root, '.nojekyll')

makeCommit: ->
console.log 'committing to git'
execute 'git add .'
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"sync-prompt": "^0.2.2",
"argparse": "^0.1.15",
"fobject": "0.0.0",
"json-schema": "^0.2.2"
"json-schema": "^0.2.2",
"touch": "0.0.3"
},
"devDependencies": {
"coffee-script": "1.7.x",
Expand Down

0 comments on commit d313492

Please sign in to comment.