Created
October 11, 2013 11:01
-
-
Save skrat/6932966 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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