不要怂,就是干,撸起袖子干!

Commit 341bb0fd by Sascha Depold

Cache the return value of supportCoffeeScript

1 parent 809ad7cf
Showing with 6 additions and 1 deletions
...@@ -7,6 +7,7 @@ var path = require("path") ...@@ -7,6 +7,7 @@ var path = require("path")
, moment = require("moment") , moment = require("moment")
, _ = Sequelize.Utils._ , _ = Sequelize.Utils._
, url = require("url") , url = require("url")
, supportCS = undefined
var configuration = { var configuration = {
configFile: process.cwd() + '/config/config.json', configFile: process.cwd() + '/config/config.json',
...@@ -170,6 +171,7 @@ if(typeof program.env === 'string') { ...@@ -170,6 +171,7 @@ if(typeof program.env === 'string') {
} }
var supportCoffeeScript = function() { var supportCoffeeScript = function() {
if (supportCS === undefined) {
try { try {
config = readConfig() config = readConfig()
} catch(e) { } catch(e) {
...@@ -177,7 +179,10 @@ var supportCoffeeScript = function() { ...@@ -177,7 +179,10 @@ var supportCoffeeScript = function() {
process.exit(1) process.exit(1)
} }
return program.coffee || config.coffee supportCS = program.coffee || config.coffee
}
return supportCS
} }
if (program.migrate || program.undo) { if (program.migrate || program.undo) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!