Skip to content

Commit

Permalink
[cli] Skip dataset validation on CI-environment
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Mar 3, 2018
1 parent 4e73a08 commit 2d4a1f0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/@sanity/cli/src/actions/init-project/initProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import bootstrapTemplate from './bootstrapTemplate'
import templates from './templates'

/* eslint-disable no-process-env */
const isCI = process.env.CI
const sanityEnv = process.env.SANITY_ENV
const environment = sanityEnv ? sanityEnv : process.env.NODE_ENV
/* eslint-enable no-process-env */
Expand Down Expand Up @@ -232,6 +233,10 @@ export default async function initSanity(args, context) {
}

async function getOrCreateDataset(opts) {
if (opts.dataset && isCI) {
return {datasetName: opts.dataset}
}

const client = apiClient({api: {projectId: opts.projectId}})
const datasets = await client.datasets.list()

Expand Down

0 comments on commit 2d4a1f0

Please sign in to comment.