From 1119c2e77e5ba158350d8e6cfd94df633a95f547 Mon Sep 17 00:00:00 2001 From: "Nicolas Froidure (7Digital)" Date: Sat, 11 Feb 2017 15:17:39 +0100 Subject: [PATCH] Remove new line of the .token file --- gulpplugins/ghrequest.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gulpplugins/ghrequest.js b/gulpplugins/ghrequest.js index 29afb441..7c1a655d 100644 --- a/gulpplugins/ghrequest.js +++ b/gulpplugins/ghrequest.js @@ -15,7 +15,8 @@ module.exports = function ghrequest(url) { // Reading the access token if not doe yet if(!token) { try { - token = fs.readFileSync(path.join(__dirname, '..', '.token'), 'utf-8'); + token = fs.readFileSync(path.join(__dirname, '..', '.token'), 'utf-8') + .replace(/[\r\n]+/g, ''); } catch(err) { gutil.log('ghrequest: Create a .token file containing a GitHub API' + ' token in the root directory of the project' +