Permalink
Browse files

use existsSync in `fs` or `path` modules.

  • Loading branch information...
1 parent 2530dcb commit a26a9c6f149cd0268bd7af98c0489a0eb7b711fe @donpark committed Jul 7, 2012
Showing with 5 additions and 3 deletions.
  1. +4 −2 bin/html2jade
  2. +1 −1 package.json
View
@@ -4,6 +4,8 @@ var fs = require('fs');
var path = require('path');
var url = require('url');
+var existsSync = fs.existsSync || path.existsSync;
+
var html2jade;
try {
html2jade = require('html2jade');
@@ -51,7 +53,7 @@ program
program.parse(process.argv);
// if outdir is provided, check existance (sorry no mkdir support yet)
-if (program.outdir && !path.existsSync(program.outdir)) {
+if (program.outdir && !existsSync(program.outdir)) {
console.error("output directory '" + program.outdir + "' doesn't exist");
process.exit(1);
}
@@ -89,7 +91,7 @@ for (var i = 0; i < args.length; i++) {
} else {
// path or glob
inputPath = parsePath(arg);
- if (path.existsSync(inputPath)) {
+ if (existsSync(inputPath)) {
var inputStats = fs.statSync(inputPath);
if (inputStats.isFile()) {
var outdir = program.outdir || path.dirname(arg);
View
@@ -1,7 +1,7 @@
{
"name": "html2jade",
"description": "HTML to Jade conversion tool",
- "version": "0.1.19",
+ "version": "0.1.20",
"author": "Don Park <donpark@docuverse.com>",
"repository": "git://github.com/donpark/html2jade.git",
"main": "index",

0 comments on commit a26a9c6

Please sign in to comment.