From 14eb2d26177efa940526f29f703eef7d3e914a75 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Thu, 13 Sep 2018 13:13:16 +1200 Subject: [PATCH] Warning only if building in dev mode without Leanplum config. --- Gruntfile.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d9bd6476e..a38f87d5d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -417,15 +417,20 @@ module.exports = function(grunt) { // Release desktop grunt.registerTask('build-desktop-release', ['build-desktop', 'sign-desktop']); - + function processLeanplumConfig(content, env) { var leanplumConfig = {}; try { leanplumConfig = grunt.file.readJSON('../leanplum-config.json'); } catch (e) { - // Without this, there is no clue on the console about what happened. - console.error('Error reading JSON', e); - throw e; + // Without this, there is no clue on the console about what happened. + if (env === 'prod') { + console.error('Error reading JSON', e); + throw e; + } else { // Allow people to build if they don't care about Leanplum + console.warn('Failed to read Leanplum config JSON', e); + return content; + } } var leanplumForEnv = env === 'prod' ? leanplumConfig.prod : leanplumConfig.dev;