From 98eb92a0a999c38b53f97ad69ab255aeedc47127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Fern=C3=A1ndez=20Capel?= Date: Tue, 10 Apr 2018 14:01:32 +0100 Subject: [PATCH 1/2] Allow .js setting files --- libraries/settings/Settings.coffee | 7 ++++--- libraries/settings/package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/settings/Settings.coffee b/libraries/settings/Settings.coffee index 81fc8977f5..9517e02bcc 100755 --- a/libraries/settings/Settings.coffee +++ b/libraries/settings/Settings.coffee @@ -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 - diff --git a/libraries/settings/package.json b/libraries/settings/package.json index 42c0b46c30..692c0b7b91 100644 --- a/libraries/settings/package.json +++ b/libraries/settings/package.json @@ -2,7 +2,7 @@ "name": "settings-sharelatex", "homepage": "www.sharelatex.com", "description": "A centralised settings system for ShareLaTeX", - "version": "1.0.0", + "version": "1.0.1", "repository": { "type": "git", "url": "https://github.com/sharelatex/settings-sharelatex.git" From 006cfb0142d20afecf096e1731d06d35f651c4db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Fern=C3=A1ndez=20Capel?= Date: Wed, 11 Apr 2018 14:08:18 +0100 Subject: [PATCH 2/2] Upgrade minor version The last change introduced a new but compatible feature. --- libraries/settings/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/settings/package.json b/libraries/settings/package.json index 692c0b7b91..978a782b03 100644 --- a/libraries/settings/package.json +++ b/libraries/settings/package.json @@ -2,7 +2,7 @@ "name": "settings-sharelatex", "homepage": "www.sharelatex.com", "description": "A centralised settings system for ShareLaTeX", - "version": "1.0.1", + "version": "1.1.0", "repository": { "type": "git", "url": "https://github.com/sharelatex/settings-sharelatex.git"