mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #2 from sharelatex/afc-js-settings
Allow .js setting files
This commit is contained in:
commit
efadf662f2
2 changed files with 5 additions and 4 deletions
|
@ -10,9 +10,9 @@ merge = (settings, defaults) ->
|
|||
defaults[key] = value
|
||||
return defaults
|
||||
|
||||
defaultSettingsPath = path.normalize(__dirname + "/../../config/settings.defaults.coffee")
|
||||
defaultSettingsPath = path.normalize(__dirname + "/../../config/settings.defaults")
|
||||
|
||||
if fs.existsSync(defaultSettingsPath)
|
||||
if fs.existsSync("#{defaultSettingsPath}.coffee") or fs.existsSync("#{defaultSettingsPath}.js")
|
||||
defaults = require(defaultSettingsPath)
|
||||
settingsExist = true
|
||||
else
|
||||
|
@ -23,6 +23,8 @@ if process.env.SHARELATEX_CONFIG?
|
|||
possibleConfigFiles = [process.env.SHARELATEX_CONFIG]
|
||||
else
|
||||
possibleConfigFiles = [
|
||||
process.cwd() + "/config/settings.#{env}.js"
|
||||
path.normalize(__dirname + "/../../config/settings.#{env}.js")
|
||||
process.cwd() + "/config/settings.#{env}.coffee"
|
||||
path.normalize(__dirname + "/../../config/settings.#{env}.coffee")
|
||||
]
|
||||
|
@ -37,4 +39,3 @@ if !settingsExist
|
|||
console.warn "No settings or defaults found. I'm flying blind."
|
||||
|
||||
module.exports = defaults
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "settings-sharelatex",
|
||||
"homepage": "www.sharelatex.com",
|
||||
"description": "A centralised settings system for ShareLaTeX",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sharelatex/settings-sharelatex.git"
|
||||
|
|
Loading…
Reference in a new issue