diff --git a/index.js b/index.js index 8043be8eaf..a42b89595e 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 = env !== 'production' ? 'staging' : 'master' + const environment = hexo.env.GATSBY_CONTENTFUL_ENVIRONMENT || process.env.GATSBY_CONTENTFUL_ENVIRONMENT || 'master' if (typeof space === 'undefined' || typeof accessToken === 'undefined') { return reject({