From 918756f14c73f1d7030bf0294ef6470b2c48324e Mon Sep 17 00:00:00 2001 From: Farrin Reid Date: Sat, 7 Jul 2012 05:17:43 -0800 Subject: [PATCH 1/2] [fix] path.exists was moved to fs.exists --- lib/Client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Client.js b/lib/Client.js index 0d72178..62d459d 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -195,7 +195,7 @@ Client.prototype._stageTempApp = function(appDir, callback) { var stageName = md5.digest('hex'); stageDir = path.join(mainTempDir, "vcap-" + stageName) - if(path.exists(stageDir)) { + if(fs.exists(stageDir)) { fs.rmdirSync(stageDir) } cp_rf(appDir, stageDir, function(err) { @@ -204,7 +204,7 @@ Client.prototype._stageTempApp = function(appDir, callback) { } else { // Zip it. var zipPath =path.join(mainTempDir, "vcap-" + stageName + ".zip") - if(path.exists(zipPath)) { + if(fs.exists(zipPath)) { fs.unlinkSync(zipPath) } zip(stageDir, zipPath, function(err) { From 1df93cd5246121abaadccfef6887d888c55c2fa5 Mon Sep 17 00:00:00 2001 From: Farrin Reid Date: Sat, 7 Jul 2012 05:17:43 -0800 Subject: [PATCH 2/2] [fix] path.existsSync was moved to fs.existsSync --- examples/credentials.js | 2 +- lib/Client.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/credentials.js b/examples/credentials.js index 3b1ee01..1ee3e25 100644 --- a/examples/credentials.js +++ b/examples/credentials.js @@ -2,7 +2,7 @@ var fs = require('fs'); var path = require('path'); var credentialsFilePath = path.join(__dirname, 'credentials.json'); -if(!path.existsSync(credentialsFilePath)) { +if(!fs.existsSync(credentialsFilePath)) { throw "Before running any example, be sure to put your cloud credentials in the examples/credentials.json file. Use examples/credentials-sample.json as an guide"; } var credentials = JSON.parse(fs.readFileSync(credentialsFilePath)); diff --git a/lib/Client.js b/lib/Client.js index 62d459d..2e6617a 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -176,7 +176,7 @@ function getTempDir() { return envPath } } else { - if(path.existsSync(checkPath.fs)) { + if(fs.existsSync(checkPath.fs)) { return checkPath.fs } }