Browse files

fix

  • Loading branch information...
1 parent acfe3f5 commit 7c33d05d9f8b410367e0306fa70622ef885a67b7 Tiago Rodrigues committed May 14, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 bin/replace_script_tags.js
View
6 bin/replace_script_tags.js
@@ -2,6 +2,7 @@ var fs = require('fs'),
path = require('path'),
srcFile = process.argv[2];
+ console.log('changing '+ srcFile);
if(!srcFile){
console.log('fail');
process.exit(1);
@@ -14,12 +15,15 @@ if(path.existsSync(path.dirname(srcFile)+'/../.git')){
fs.readFile(srcFile, 'utf-8', function(err, data) {
if(err) throw err;
+ console.log('replacing');
+ console.log(/<!--START-SCRIPT-TAGS(.|\s|\n)*END-SCRIPT-TAGS-->/g.exec(data));
data = data.replace(
- /<!--START-SCRIPT-TAGS(.|\s|\n)*END-SCRIPT-TAGS-->/gm,
+ /<!--START-SCRIPT-TAGS(.|\s|\n)*END-SCRIPT-TAGS-->/g,
'<script src="assets/js/lxjs.min.js"></script>'
);
+ console.log('writing');
fs.writeFile(srcFile, data, 'utf-8', function(err) {
if(err) throw err;
console.log('file '+srcFile+' is ready');

0 comments on commit 7c33d05

Please sign in to comment.