Skip to content

Commit

Permalink
Merge pull request remy#46 from jpotter/master
Browse files Browse the repository at this point in the history
Fix calls to existsSync; fix non-zero exit code on error
  • Loading branch information
remy committed Feb 25, 2015
2 parents 60d7cd7 + 4fb1190 commit e628109
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/inliner
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fs.realpath(__filename, function(error, script) {

var url = program.args[0];

if (path.existsSync(url)) {
if (fs.existsSync(url)) {
// then it's a file
} else if (url.indexOf('http') !== 0) {
url = 'http://' + url;
Expand Down
3 changes: 2 additions & 1 deletion inliner.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ function Inliner(url, options, callback) {

} catch (e) {
inliner.emit('error', 'Fatal error parsing HTML - exiting');
process.exit(1);
}
}
});
Expand Down Expand Up @@ -341,7 +342,7 @@ Inliner.prototype.get = function (url, options, callback) {
var inliner = this;

// TODO remove the sync
if (path.existsSync(url)) {
if (fs.existsSync(url)) {
// then we're dealing with a file
fs.readFile(url, 'utf8', function (err, body) {
inliner.requestCache[url] = body;
Expand Down

0 comments on commit e628109

Please sign in to comment.