Skip to content

Instantly share code, notes, and snippets.

@skrat
Created October 11, 2013 11:01
Show Gist options
  • Save skrat/6932966 to your computer and use it in GitHub Desktop.
Save skrat/6932966 to your computer and use it in GitHub Desktop.
walk src_dir, (err, results) ->
stream = process.stdout
stream.write "# DO NOT MODIFY - Generated file\n#\n\n"
for pattern, hook of asset_hooks
results
.filter((asset_path) -> asset_path.match(pattern))
.forEach (asset_path) ->
rel = path.relative(src_dir, asset_path)
stream.write "module.exports['#{rel}'] = \"\"\""
fs.createReadStream(asset_path)
.pipe(jpp(null))
.pipe(stream)
stream.write "\n\"\"\"\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment