Skip to content
Browse files

stylize fix

  • Loading branch information...
1 parent cbc602d commit 047de833ad71ea5ecac5031b81c12c09da5808f4 @mklabs committed Oct 11, 2011
Showing with 7 additions and 3 deletions.
  1. +2 −0 lib/datauri.js
  2. +4 −3 lib/helper.js
  3. +1 −0 package.json
View
2 lib/datauri.js
@@ -4,6 +4,8 @@ var fs = require('fs'),
helpers = require('./helper');
// This is non-sense, but mhtml have to use absolute path to the css files
+// todo: this is temporary. configuration needs to be managed better,
+// probably using a robust command line parser (nopt, optimist, commander).
var config = {
host: 'http://example.com'
};
View
7 lib/helper.js
@@ -16,16 +16,17 @@ exports.toBase64 = function toBase64(path) {
try {
return fs.readFileSync(path, 'base64');
} catch(e) {
- console.error(stylize('Unable to locate ', stylize(path.replace(process.cwd(), ''), 'bold'), 'yellow'));
+ console.error(exports.stylize('Unable to locate ', exports.stylize(path.replace(process.cwd(), ''), 'bold'), 'yellow'));
+ console.error(' ', exports.stylize('Will leave the url declaration as is.', 'green'));
}
};
exports.toUTF = function toUTF(path) {
try {
return fs.readFileSync(path, 'utf8');
} catch(e) {
- console.error(stylize('Unable to locate ', stylize(path.replace(process.cwd(), ''), 'bold'), 'red'));
- console.error(stylize('Cannot proceed with a wrong list of files.', 'red'));
+ console.error(exports.stylize('Unable to locate ', exports.stylize(path.replace(process.cwd(), ''), 'bold'), 'red'));
+ console.error(exports.stylize('Cannot proceed with a wrong list of files.', 'red'));
process.exit(1);
}
};
View
1 package.json
@@ -4,6 +4,7 @@
"description": "script to automate embedding of base64 images in CSS files",
"version": "0.0.0",
"bin": "./bin/datauri",
+ "lib": "./lib/datauri",
"directories": {
"man": "./docs/man/"
},

0 comments on commit 047de83

Please sign in to comment.
Something went wrong with that request. Please try again.