Skip to content

Commit 82ae2b5

Browse files
devversionkara
authored andcommitted
chore: remove line-break escapes in firebase private key (#2510)
1 parent 161f319 commit 82ae2b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/gulp/task_helpers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ export function openFirebaseDatabase() {
221221
credential: firebaseAdmin.credential.cert({
222222
project_id: 'material2-dashboard',
223223
client_email: 'firebase-adminsdk-ch1ob@material2-dashboard.iam.gserviceaccount.com',
224-
private_key: process.env['MATERIAL2_FIREBASE_PRIVATE_KEY']
224+
// In Travis CI the private key will be incorrect because the line-breaks are escaped.
225+
// The line-breaks need to persist in the service account private key.
226+
private_key: (process.env['MATERIAL2_FIREBASE_PRIVATE_KEY'] || '').replace(/\\n/g, '\n')
225227
}),
226228
databaseURL: 'https://material2-dashboard.firebaseio.com'
227229
});

0 commit comments

Comments
 (0)