From 5b6433be66c6886ec08fa3e5a879c90cfc992c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Daoust?= Date: Mon, 14 Dec 2020 19:47:11 +0100 Subject: [PATCH] Fix build script to read GITHUB_TOKEN from env whenever needed The script was only reading the token from the environment when config.json did not exist. But the file could exist **and** not contain the right key. --- src/build-index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/build-index.js b/src/build-index.js index 8efc1300..a3b3438a 100644 --- a/src/build-index.js +++ b/src/build-index.js @@ -22,9 +22,9 @@ const githubToken = (_ => { return require("../config.json").githubToken; } catch { - return process.env.GITHUB_TOKEN; + return ""; } -})(); +})() || process.env.GITHUB_TOKEN;; // If the index already exists, reuse the info it contains when info cannot // be refreshed due to some external (network) issue.