From d313492191ada7d8889923a810a9d7329c57e7de Mon Sep 17 00:00:00 2001 From: Sean Lang Date: Sat, 3 May 2014 09:10:38 -0500 Subject: [PATCH] add .nojekyll option, closes #19 --- lib/deployers/gh-pages/index.coffee | 10 ++++++++++ package.json | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/deployers/gh-pages/index.coffee b/lib/deployers/gh-pages/index.coffee index 5e0f345..74b0c13 100644 --- a/lib/deployers/gh-pages/index.coffee +++ b/lib/deployers/gh-pages/index.coffee @@ -1,6 +1,7 @@ path = require 'path' fs = require 'fs' shell = require 'shelljs/global' +touch = require('touch').sync readdirp = require 'readdirp' W = require 'when' @@ -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) @@ -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) ) @@ -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 .' diff --git a/package.json b/package.json index 1546f8b..50b2767 100644 --- a/package.json +++ b/package.json @@ -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",