juanca/sprockets-preloader

Write to disk

racerpeter opened this issue · 1 comments

In loader.js before the final return:

var fs = require('fs');
fs.writeFile(this.resourcePath, output);
console.log(this.resourcePath + ' ++++++++++++++++++++\n\n\n');

And I had to remove the absolute paths with a few sed commands:

find . -name *.coffee | xargs sed -ie 's~/Users/peter/workspace/mavenlink/node_modules/~~'
find . -name *.js | xargs sed -ie 's~/Users/peter/workspace/mavenlink/node_modules/~~'
find . -name *.coffeee | xargs rm -f
find . -name *.jse | xargs rm -f

A gist with some Shell nuggets I've assembled that I've found useful when doing replacements: https://gist.github.com/naganowl/0e6211498e028c606f14ec1140a49996