Skip to content

Instantly share code, notes, and snippets.

@jish
Created June 29, 2015 20:39
Show Gist options
  • Save jish/3faa713ab97e582b2a91 to your computer and use it in GitHub Desktop.
Save jish/3faa713ab97e582b2a91 to your computer and use it in GitHub Desktop.
Conditionally copy foo
var Funnel = require('broccoli-funnel')
var MergeTrees = require('broccoli-merge-trees')
var trees = []
var currentIndex = new Funnel('.', {
include: ['index.html'],
destDir: 'current'
})
trees.push(currentIndex)
if (process.env.FOO) {
var fooIndex = new Funnel('.', {
include: ['index.html'],
destDir: 'foo'
})
trees.push(fooIndex)
}
module.exports = new MergeTrees(trees)
@jish
Copy link
Author

jish commented Jun 29, 2015

$ broccoli build dist
$ find dist
dist
dist/current
dist/current/index.html

$ FOO=1 broccoli build dist
$ find dist
dist
dist/current
dist/current/index.html
dist/foo
dist/foo/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment