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 0d72178..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 } } @@ -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) {