Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Deal with deprecated path.existsSync

  • Loading branch information...
commit 87c8ae3ff04f0569c21ded19968195ea8b7d271c 1 parent a71f663
@rehandalal rehandalal authored
Showing with 9 additions and 3 deletions.
  1. +5 −2 migrate.js
  2. +4 −1 standup-irc.js
View
7 migrate.js
@@ -1,8 +1,11 @@
var _ = require('underscore');
+var fs = require('fs');
var path = require('path');
+var existsSync = fs.existsSync || path.existsSync;
+
// Global config.
-if (path.existsSync('./config.json')) {
+if (existsSync('./config.json')) {
config = require('./config.json');
}
@@ -36,7 +39,7 @@ if (config.pg.enabled) {
query.on('end', function(result) {
current++;
- while(path.existsSync('./migrations/' + current + '.js')) {
+ while(existsSync('./migrations/' + current + '.js')) {
console.log('Running migration #' + current);
var migration = require('./migrations/' + current);
migration.upgrade(client);
View
5 standup-irc.js
@@ -1,4 +1,5 @@
var _ = require('underscore');
+var fs = require('fs');
var irc = require('irc');
var path = require('path');
var pg = require('pg');
@@ -25,8 +26,10 @@ var defaults = {
}
};
+var existsSync = fs.existsSync || path.existsSync;
+
// Global config.
-if (path.existsSync('./config.json')) {
+if (existsSync('./config.json')) {
config = require('./config.json');
}
Please sign in to comment.
Something went wrong with that request. Please try again.