From 4229bfabf28c5f8118a0affa03facb039d9cd263 Mon Sep 17 00:00:00 2001 From: Anton Synenko Date: Wed, 11 Sep 2019 18:00:23 +0300 Subject: [PATCH] contentful environment variable declaration based on ternary operator if hexo env eq "production" or not --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index bd534ecb50..f3c065ac32 100644 --- a/index.js +++ b/index.js @@ -100,7 +100,7 @@ function initHexo () { return new Promise((resolve, reject) => { const space = hexo.env.GATSBY_CONTENTFUL_SPACE_ID || process.env.GATSBY_CONTENTFUL_SPACE_ID const accessToken = hexo.env.GATSBY_CONTENTFUL_ACCESS_TOKEN || process.env.GATSBY_CONTENTFUL_ACCESS_TOKEN - const environment = hexo.env.GATSBY_CONTENTFUL_ENVIRONMENT || process.env.GATSBY_CONTENTFUL_ENVIRONMENT || 'master' + const environment = env !== 'production' ? 'staging' : 'master' if (typeof space === 'undefined' || typeof accessToken === 'undefined') { return reject({