mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-23 06:11:25 +00: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")
|
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}.coffee 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