Comparing version 0.2.0 to 0.2.1
@@ -13,4 +13,8 @@ #!/usr/bin/env node | ||
// what mode are we running in, HTML or JS? | ||
var mode = path.extname(argv.i).replace(/^\./, ''); | ||
// swtich the regular expression based on mode | ||
var regex = (mode === 'js') ? fuse.reJS : fuse.reHTML; | ||
// let's grab each file that we need to watch | ||
var a = fuse.getReferencedFiles(fuse.getFileContent(argv.i)); | ||
var a = fuse.getReferencedFiles(fuse.getFileContent(argv.i), regex); | ||
var relativePath = path.dirname(argv.i) + '/'; | ||
@@ -17,0 +21,0 @@ |
@@ -53,3 +53,3 @@ (function () { | ||
// grab a list of the referenced files | ||
var matches = fuse.getReferencedFiles(content); | ||
var matches = fuse.getReferencedFiles(content, this.re); | ||
// determine the relative path we need to work from | ||
@@ -246,6 +246,6 @@ var relativePath = path.dirname(path.normalize(inputFile)); | ||
// get a list of the files to include, from the input file | ||
fuse.getReferencedFiles = function (content) { | ||
fuse.getReferencedFiles = function (content, regex) { | ||
var paths = []; | ||
var matches = content.match(fuse.re); | ||
var matches = content.match(regex); | ||
@@ -255,3 +255,3 @@ _.each(matches, function (match) { | ||
// ok, determine the file name | ||
var filepath = match.replace(fuse.re, '$1'); | ||
var filepath = match.replace(regex, '$1'); | ||
@@ -258,0 +258,0 @@ // return the filepath, and the original string |
@@ -13,4 +13,4 @@ { | ||
"directories" : { "bin": "./bin" }, | ||
"version" : "0.2.0", | ||
"version" : "0.2.1", | ||
"engines" : {"node": ">=0.4"} | ||
} |
@@ -1,2 +0,2 @@ | ||
# Fuse [![Build Status][image-1]][1] | ||
# Fuse [![build status](https://secure.travis-ci.org/smebberson/fuse.png)][1] | ||
@@ -3,0 +3,0 @@ > Fuse is a command line tool to fuse multiple JavaScript or HTML files into one. If you're fusing JavaScript you can optionally compress or mangle the JavaScript code. |
34332
780