Skip to content

Commit

Permalink
fix: move cliInitializedAt call higher in init flow
Browse files Browse the repository at this point in the history
  • Loading branch information
svirs committed Oct 1, 2024
1 parent 306a671 commit 5a4e770
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/@sanity/cli/src/actions/init-project/initProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,11 +594,8 @@ export default async function initSanity(

trace.log({step: 'importTemplateDataset', selectedOption: shouldImport ? 'yes' : 'no'})

// Bootstrap Sanity, creating required project files, manifests etc
await bootstrapTemplate(templateOptions, context)

// update that files were initialized locally; do not halt flow for request
apiClient({api: {projectId: projectId}})
// record that template files attempted to be created locally
await apiClient({api: {projectId: projectId}})
.request<SanityProject>({uri: `/projects/${projectId}`})
.then((project: SanityProject) => {
if (!project?.metadata?.cliInitializedAt) {
Expand All @@ -615,6 +612,9 @@ export default async function initSanity(
debug('Failed to update cliInitializedAt metadata')
})

// Bootstrap Sanity, creating required project files, manifests etc
await bootstrapTemplate(templateOptions, context)

let pkgManager: PackageManager

// If the user has specified a package manager, and it's allowed use that
Expand Down

0 comments on commit 5a4e770

Please sign in to comment.