Comparing version 0.0.1 to 0.0.11
25
index.js
@@ -6,8 +6,9 @@ #!/usr/bin/env node | ||
API = null, | ||
fs = require("fs"); | ||
absurd = null, | ||
fs = require("fs"), | ||
argv = require('optimist').argv, | ||
cli = require('./lib/CLI.js'); | ||
module.exports = absurd = function(path) { | ||
module.exports = function(path) { | ||
API = require("./lib/API.js")(); | ||
@@ -23,3 +24,7 @@ | ||
} else { | ||
require(_path.source)(API); | ||
try { | ||
require(_path.source)(API); | ||
} catch(err) { | ||
console.log("Error: I can't find '" + _path.source + "'."); | ||
} | ||
} | ||
@@ -50,2 +55,10 @@ Processor( | ||
} | ||
} | ||
// godlike | ||
process.on('uncaughtException', function (err) { | ||
console.log("Error packing", err); | ||
}); | ||
// cli | ||
cli(argv, absurd); |
module.exports = function(API) { | ||
return function(path) { | ||
if(typeof path == 'string') { | ||
require(path)(API); | ||
try { | ||
require(path)(API) | ||
} catch(err) { | ||
console.log("Error: I can't find '" + path + "'."); | ||
} | ||
} else { | ||
for(var i=0; p=path[i]; i++) { | ||
require(p)(API); | ||
try { | ||
require(p)(API); | ||
} catch(err) { | ||
console.log("Error: I can't find '" + p + "'."); | ||
} | ||
} | ||
@@ -9,0 +17,0 @@ } |
{ | ||
"name": "absurd", | ||
"version": "0.0.1", | ||
"version": "0.0.11", | ||
"homepage": "https://github.com/krasimir/absurd", | ||
@@ -10,3 +10,3 @@ "description": "CSS preprocessor", | ||
"dependencies": { | ||
"optimist": "0.6.0" | ||
}, | ||
@@ -13,0 +13,0 @@ "keywords": [ |
9097
21
324
1
+ Addedoptimist@0.6.0
+ Addedminimist@0.0.10(transitive)
+ Addedoptimist@0.6.0(transitive)
+ Addedwordwrap@0.0.3(transitive)