Merge pull request #203 from VShell/fix-exists

Fix fs.exists to existsSync where necessary
This commit is contained in:
Mattias Erming 2014-10-02 01:29:32 +02:00
commit 2a400efc24

View File

@ -4,9 +4,9 @@ var path = require("path");
var Helper = module.exports = { var Helper = module.exports = {
getConfig: function () { getConfig: function () {
var filename = process.env.SHOUT_CONFIG; var filename = process.env.SHOUT_CONFIG;
if(!filename || !fs.exists(filename)) { if(!filename || !fs.existsSync(filename)) {
filename = this.resolveHomePath("config.js"); filename = this.resolveHomePath("config.js");
if(!fs.exists(filename)) { if(!fs.existsSync(filename)) {
filename = path.resolve(__dirname, "..", "config"); filename = path.resolve(__dirname, "..", "config");
} }
} }
@ -15,7 +15,7 @@ var Helper = module.exports = {
getHomeDirectory: function () { getHomeDirectory: function () {
return ( return (
(process.env.SHOUT_CONFIG && fs.exists(process.env.SHOUT_CONFIG) && this.getConfig().home) (process.env.SHOUT_CONFIG && fs.existsSync(process.env.SHOUT_CONFIG) && this.getConfig().home)
|| process.env.SHOUT_HOME || process.env.SHOUT_HOME
|| path.resolve(process.env.HOME, ".shout") || path.resolve(process.env.HOME, ".shout")
); );