From 82ae2b53023f78ed5d708a6b7e0259e941beaa58 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 4 Jan 2017 02:18:40 +0100 Subject: [PATCH] chore: remove line-break escapes in firebase private key (#2510) --- tools/gulp/task_helpers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/gulp/task_helpers.ts b/tools/gulp/task_helpers.ts index ac158ceeeef..90466174ea0 100644 --- a/tools/gulp/task_helpers.ts +++ b/tools/gulp/task_helpers.ts @@ -221,7 +221,9 @@ export function openFirebaseDatabase() { credential: firebaseAdmin.credential.cert({ project_id: 'material2-dashboard', client_email: 'firebase-adminsdk-ch1ob@material2-dashboard.iam.gserviceaccount.com', - private_key: process.env['MATERIAL2_FIREBASE_PRIVATE_KEY'] + // In Travis CI the private key will be incorrect because the line-breaks are escaped. + // The line-breaks need to persist in the service account private key. + private_key: (process.env['MATERIAL2_FIREBASE_PRIVATE_KEY'] || '').replace(/\\n/g, '\n') }), databaseURL: 'https://material2-dashboard.firebaseio.com' });