From 9b4d7e65def4d5b74d3625b69135a55c9e6a4c69 Mon Sep 17 00:00:00 2001 From: James Allen Date: Sun, 23 Feb 2014 11:45:08 +0000 Subject: [PATCH] Use example config file so that config changes do not interfere with git --- server-ce/Gruntfile.coffee | 17 +++++++++++++++-- ...ffee => settings.development.coffee.example} | 0 2 files changed, 15 insertions(+), 2 deletions(-) rename server-ce/config/{settings.development.coffee => settings.development.coffee.example} (100%) diff --git a/server-ce/Gruntfile.coffee b/server-ce/Gruntfile.coffee index 90208723f3..de115a234f 100644 --- a/server-ce/Gruntfile.coffee +++ b/server-ce/Gruntfile.coffee @@ -77,9 +77,13 @@ module.exports = (grunt) -> Helpers.updateService(service.name, done) grunt.registerTask "run:#{service.name}", "Run the ShareLaTeX #{service.name} service", ["bunyan", "execute:#{service.name}"] - grunt.registerTask 'install:all', "Download and set up all ShareLaTeX services", ("install:#{service.name}" for service in SERVICES) + grunt.registerTask 'install:config', "Copy the example config into the real config", () -> + Helpers.installConfig @async() + grunt.registerTask 'install:all', "Download and set up all ShareLaTeX services", + ("install:#{service.name}" for service in SERVICES).concat(["install:config"]) grunt.registerTask 'install', 'install:all' - grunt.registerTask 'update:all', "Checkout and update all ShareLaTeX services", ("update:#{service.name}" for service in SERVICES) + grunt.registerTask 'update:all', "Checkout and update all ShareLaTeX services", + ("update:#{service.name}" for service in SERVICES) grunt.registerTask 'update', 'update:all' grunt.registerTask 'run', "Run all of the sharelatex processes", ['concurrent:all'] grunt.registerTask 'run:all', 'run' @@ -135,6 +139,15 @@ module.exports = (grunt) -> proc.on "close", () -> callback() + installConfig: (callback = (error) ->) -> + if !fs.existsSync("config/settings.development.coffee") + grunt.log.writeln "Copying example config into config/settings.development.coffee" + exec "cp config/settings.development.coffee.example config/settings.development.coffee", (error, stdout, stderr) -> + callback(error) + else + grunt.log.writeln "Config file already exists. Skipping." + callback() + runGruntInstall: (dir, callback = (error) ->) -> proc = spawn "grunt", ["install"], stdio: "inherit", cwd: dir proc.on "close", () -> diff --git a/server-ce/config/settings.development.coffee b/server-ce/config/settings.development.coffee.example similarity index 100% rename from server-ce/config/settings.development.coffee rename to server-ce/config/settings.development.coffee.example