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

Commit 341bb0fd by Sascha Depold

Cache the return value of supportCoffeeScript

1 parent 809ad7cf
Showing with 11 additions and 6 deletions
......@@ -7,6 +7,7 @@ var path = require("path")
, moment = require("moment")
, _ = Sequelize.Utils._
, url = require("url")
, supportCS = undefined
var configuration = {
configFile: process.cwd() + '/config/config.json',
......@@ -170,14 +171,18 @@ if(typeof program.env === 'string') {
}
var supportCoffeeScript = function() {
try {
config = readConfig()
} catch(e) {
console.log(e.message)
process.exit(1)
if (supportCS === undefined) {
try {
config = readConfig()
} catch(e) {
console.log(e.message)
process.exit(1)
}
supportCS = program.coffee || config.coffee
}
return program.coffee || config.coffee
return supportCS
}
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!