From 18e2012f899e2a057f7471e52aad8841565627e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 25 Sep 2018 08:41:38 +0200 Subject: [PATCH] MOBILE-2626 gulp: Admit single quotes in config.json --- gulpfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 46f1b77f1..54402b920 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -251,8 +251,8 @@ gulp.task('config', function(done) { for (var key in config) { var value = config[key]; if (typeof value == 'string') { - // Wrap the string in ' . - value = "'" + value + "'"; + // Wrap the string in ' and scape them. + value = "'" + value.replace(/([^\\])'/g, "$1\\'") + "'"; } else if (typeof value != 'number' && typeof value != 'boolean') { // Stringify with 4 spaces of indentation, and then add 4 more spaces in each line. value = JSON.stringify(value, null, 4).replace(/^(?: )/gm, ' ').replace(/^(?:})/gm, ' }');