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