Comparing version 0.0.5 to 0.0.6
@@ -8,2 +8,3 @@ #!/usr/bin/env node | ||
var fuse = require('../lib/fuse'); | ||
var path = require('path'); | ||
@@ -14,3 +15,3 @@ if (argv.w) { | ||
var a = fuse.getReferencedFiles(fuse.getFileContent(argv.i)); | ||
var relativePath = fuse.getFilePath(argv.i); | ||
var relativePath = path.dirname(argv.i); | ||
@@ -17,0 +18,0 @@ // loop through an setup a watch on each referenced file |
var colors = require('colors'); | ||
var fs = require('fs'); | ||
var _ = require('underscore'); | ||
var util = require('util'); | ||
var path = require('path'); | ||
@@ -26,3 +28,3 @@ var fuse = exports; | ||
fuse.fuseFile = function (inputFile, outputFile, exit) { | ||
// reference argument variables, so we can referrer to them in anonymous functions | ||
@@ -38,3 +40,3 @@ var inputFile = inputFile; | ||
// determine the relative path we need to work from | ||
var relativePath = fuse.getFilePath(inputFile); | ||
var relativePath = path.dirname(path.normalize(inputFile)); | ||
// output is a version of the content that we'll update | ||
@@ -54,4 +56,4 @@ var output = content; | ||
var fileContent; | ||
var filename = match.path.replace(fuse.re, '$1'); | ||
var filepath = relativePath + filename; | ||
var filename = path.basename(match.path); | ||
var filepath = path.join(relativePath,match.path); | ||
var bFile = false; | ||
@@ -93,3 +95,3 @@ | ||
var inputFile = inputFile; | ||
var inputFileName = fuse.getFileName(inputFile); | ||
var inputFileName = path.basename(inputFile); | ||
var outputFile = outputFile; | ||
@@ -114,3 +116,3 @@ | ||
var srcFile = srcFile; | ||
var srcFileName = fuse.getFileName(srcFile); | ||
var srcFileName = path.basename(srcFile); | ||
@@ -165,6 +167,1 @@ fs.watchFile(srcFile, {'persistent': true, 'interval': 1000}, function (curr, prev) { | ||
} | ||
// return only the path, removing the actual file name | ||
fuse.getFilePath = function (path) { | ||
return fs.realpathSync(path).replace(/(.+)?\/(.+)/i, '$1/'); | ||
} |
{ | ||
"name" : "fuse", | ||
"description" : "Command line combiner for fusing mutliple JavaScript files into one", | ||
"url" : "http://github.com/smebberson/fuse", | ||
"keywords" : ["combiner", "javascript", "cli", "parser", "command", "packager"], | ||
"author" : {"name": "Scott Mebberson", "email": "scott@scottmebberson.com"}, | ||
"repository" : {"type": "git", "url": "https://github.com/smebberson/fuse.git"}, | ||
"dependencies" : { "underscore": ">=1.2.0", "optimist": ">=0.2.8", "colors": ">=0.5.1" }, | ||
"bin" : { "fuse": "./bin/fuse.js" }, | ||
"directories" : { "bin": "./bin" }, | ||
"version" : "0.0.5", | ||
"engines" : {"node": ">=0.4"} | ||
"name" : "fuse", | ||
"description" : "Command line combiner for fusing mutliple JavaScript files into one", | ||
"url" : "http://github.com/smebberson/fuse", | ||
"keywords" : ["combiner", "javascript", "cli", "parser", "command", "packager"], | ||
"author" : {"name": "Scott Mebberson", "email": "scott@scottmebberson.com"}, | ||
"repository" : {"type": "git", "url": "https://github.com/smebberson/fuse.git"}, | ||
"dependencies" : { "underscore": ">=1.2.0", "optimist": ">=0.2.8", "colors": ">=0.5.1" }, | ||
"devDependencies" : { "vows": ">=0.5.13"}, | ||
"bin" : { "fuse": "./bin/fuse.js" }, | ||
"directories" : { "bin": "./bin" }, | ||
"version" : "0.0.6", | ||
"engines" : {"node": ">=0.4"} | ||
} |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
8946
16
188
1
1