Navigation Menu

Skip to content

Commit

Permalink
[fix] exists and existsSync fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jfhbrook committed Jul 10, 2012
1 parent 19c93ea commit fb49993
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/jitsu/commands/install.js
Expand Up @@ -7,6 +7,7 @@

var fs = require('fs'),
path = require('path'),
exists = fs.exists || path.exists,
common = require('../common'),
cpr = common.cpr,
rimraf = common.rimraf,
Expand Down Expand Up @@ -173,7 +174,7 @@ module.exports = function (requestedApp, callback) {
// Check if the app provides any configuration schema
//
app.config.schemaPath = './' + app.name + '/config/schema.json';
path.exists(app.config.schemaPath, function (exists) {
exists(app.config.schemaPath, function (exists) {
if (exists) {
try {
app.config.schema = JSON.parse(fs.readFileSync(app.config.schemaPath).toString());
Expand Down
3 changes: 2 additions & 1 deletion lib/jitsu/package.js
Expand Up @@ -7,6 +7,7 @@

var fs = require('fs'),
path = require('path'),
existsSync = fs.existsSync || path.existsSync,
util = require('util'),
spawnCommand = require('spawn-command'),
async = require('flatiron').common.async,
Expand Down Expand Up @@ -653,7 +654,7 @@ package.runScript = function (pkg, action, callback) {
function searchStartScript(dir) {
var scripts = ['server.js', 'bin/server', 'app.js', 'index.js'];
for (i in scripts) {
if (path.existsSync(path.join(dir, scripts[i]))) {
if (existsSync(path.join(dir, scripts[i]))) {
return scripts[i];
}
}
Expand Down

0 comments on commit fb49993

Please sign in to comment.