code: function fetchMainThemeId(env) {
    return new Promise((resolve, reject) => {
      const c = config.shopify[env]
  
      https.get({
        hostname: c.store,
        path: '/admin/themes.json',
        auth: `${c.api_key}:${c.password}`,
        agent: false
      }, (res) => {
        let body = ''
  
        res.on('data', datum => (body += datum))
  
        res.on('end', () => {
          const parsed = JSON.parse(body)
  
          if (parsed.errors) {
            reject(JSON.stringify(parsed.errors, null, '\t'))
            return
          }
  
          if (!Array.isArray(parsed.themes)) {
            reject(`
              Shopify response for /admin/themes.json is not an array.
  
              ${JSON.stringify(parsed, null, '\t')}
            `)
            return
          }
  
          const mainTheme = parsed.themes.find(t => t.role === 'main')
  
          if (!mainTheme) {
            reject(`
              No main theme in response.
  
              ${JSON.stringify(parsed.themes, null, '\t')}
            `)
            return
          }
  
          resolve(mainTheme.id)
        })
      })
    })
  }
docs: Fetch the main theme ID from Shopify
  
  @param   env   String  The environment to check against
  @return        Promise Reason for abort or the main theme ID