mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #4 from overleaf/ae-deprecate-coffee
Add deprecation warning for .coffee settings files
This commit is contained in:
commit
27778ed30c
1 changed files with 10 additions and 2 deletions
|
@ -12,8 +12,14 @@ merge = (settings, defaults) ->
|
||||||
|
|
||||||
defaultSettingsPath = path.normalize(__dirname + "/../../config/settings.defaults")
|
defaultSettingsPath = path.normalize(__dirname + "/../../config/settings.defaults")
|
||||||
|
|
||||||
if fs.existsSync("#{defaultSettingsPath}.coffee") or fs.existsSync("#{defaultSettingsPath}.js")
|
if fs.existsSync("#{defaultSettingsPath}.js")
|
||||||
defaults = require(defaultSettingsPath)
|
console.log "Using default settings from #{defaultSettingsPath}.js"
|
||||||
|
defaults = require("#{defaultSettingsPath}.js")
|
||||||
|
settingsExist = true
|
||||||
|
else if fs.existsSync("#{defaultSettingsPath}.coffee")
|
||||||
|
console.warn "CoffeeScript settings file #{defaultSettingsPath}.coffee is deprecated, please convert to JavaScript"
|
||||||
|
console.log "Using default settings from #{defaultSettingsPath}.coffee"
|
||||||
|
defaults = require("#{defaultSettingsPath}.coffee")
|
||||||
settingsExist = true
|
settingsExist = true
|
||||||
else
|
else
|
||||||
defaults = {}
|
defaults = {}
|
||||||
|
@ -31,6 +37,8 @@ else
|
||||||
|
|
||||||
for file in possibleConfigFiles
|
for file in possibleConfigFiles
|
||||||
if fs.existsSync(file)
|
if fs.existsSync(file)
|
||||||
|
if file.endsWith('.coffee')
|
||||||
|
console.warn "CoffeeScript settings file #{file} is deprecated, please convert to JavaScript"
|
||||||
console.log "Using settings from " + file
|
console.log "Using settings from " + file
|
||||||
module.exports = merge(require(file), defaults)
|
module.exports = merge(require(file), defaults)
|
||||||
settingsExist = true
|
settingsExist = true
|
||||||
|
|
Loading…
Reference in a new issue