From 3046bd994eb0ba9aa016f1b4fec69c31bdae966b Mon Sep 17 00:00:00 2001 From: Ivan De Marino Date: Thu, 4 Aug 2011 22:00:18 +0100 Subject: [PATCH] Spotted a mistake in "scandir.[js|coffee]": was still using "phantom.fs" API. --- examples/scandir.coffee | 6 +++--- examples/scandir.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/scandir.coffee b/examples/scandir.coffee index 49377c7e..f8eb026b 100644 --- a/examples/scandir.coffee +++ b/examples/scandir.coffee @@ -4,10 +4,10 @@ if phantom.args.length != 1 console.log "Usage: phantomjs scandir.js DIRECTORY_TO_SCAN" phantom.exit() scanDirectory = (path) -> - if phantom.fs.exists(path) and phantom.fs.isFile(path) + if fs.exists(path) and fs.isFile(path) console.log path - else if phantom.fs.isDir(path) - phantom.fs.list(path).forEach (e) -> + else if fs.isDirectory(path) + fs.list(path).forEach (e) -> scanDirectory path + "/" + e if e != "." and e != ".." scanDirectory phantom.args[0] diff --git a/examples/scandir.js b/examples/scandir.js index ff8a29d0..fc1bf6cb 100644 --- a/examples/scandir.js +++ b/examples/scandir.js @@ -6,10 +6,10 @@ if (phantom.args.length !== 1) { } var scanDirectory = function (path) { - if (phantom.fs.exists(path) && phantom.fs.isFile(path)) { + if (fs.exists(path) && fs.isFile(path)) { console.log(path); - } else if (phantom.fs.isDir(path)) { - phantom.fs.list(path).forEach(function (e) { + } else if (fs.isDirectory(path)) { + fs.list(path).forEach(function (e) { if ( e !== "." && e !== ".." ) { //< Avoid loops scanDirectory(path + '/' + e); }