Skip to content

Commit

Permalink
fix: temporary commit to determine why cli tests are failing
Browse files Browse the repository at this point in the history
  • Loading branch information
cngonzalez committed Jan 31, 2025
1 parent da20792 commit 4649f9a
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions packages/@sanity/cli/src/actions/init-project/initProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import {createProject} from '../project/createProject'
import {bootstrapLocalTemplate} from './bootstrapLocalTemplate'
import {bootstrapRemoteTemplate} from './bootstrapRemoteTemplate'
import {type GenerateConfigOptions} from './createStudioConfig'
import {determineStudioTemplate} from './determineStudioTemplate'
import {absolutify, validateEmptyPath} from './fsUtils'
import {tryGitInit} from './git'
import {promptForDatasetName} from './promptForDatasetName'
Expand Down Expand Up @@ -273,13 +272,6 @@ export default async function initSanity(
print('')

const flags = await prepareFlags()
// skip project / dataset prompting
const isStudioTemplate = cliFlags.template && determineStudioTemplate(cliFlags.template)
/* eslint-disable no-console */
console.log('isStudioTemplate', isStudioTemplate)
/* eslint-disable no-console */
console.log('cli flags', JSON.stringify(cliFlags))

// We're authenticated, now lets select or create a project
const {projectId, displayName, isFirstProject, datasetName, schemaUrl} = await getProjectDetails()

Expand Down Expand Up @@ -664,15 +656,11 @@ export default async function initSanity(
const isCurrentDir = outputPath === process.cwd()
if (isCurrentDir) {
print(`\n${chalk.green('Success!')} Now, use this command to continue:\n`)
print(
`${chalk.cyan(devCommand)} - to run ${isStudioTemplate ? 'Sanity Studio' : 'your Sanity application'}\n`,
)
print(`${chalk.cyan(devCommand)} - to run Sanity Studio\n`)
} else {
print(`\n${chalk.green('Success!')} Now, use these commands to continue:\n`)
print(`First: ${chalk.cyan(`cd ${outputPath}`)} - to enter project’s directory`)
print(
`Then: ${chalk.cyan(devCommand)} -to run ${isStudioTemplate ? 'Sanity Studio' : 'your Sanity application'}\n`,
)
print(`Then: ${chalk.cyan(devCommand)} - to run Sanity Studio\n`)
}

print(`Other helpful commands`)
Expand Down Expand Up @@ -733,16 +721,6 @@ export default async function initSanity(
return data
}

// currently coreApps don't need this information. Return dummy data for now
if (!isStudioTemplate) {
return {
projectId: '',
displayName: '',
isFirstProject: false,
datasetName: '',
}
}

debug('Prompting user to select or create a project')
const project = await getOrCreateProject()
debug(`Project with name ${project.displayName} selected`)
Expand Down

0 comments on commit 4649f9a

Please sign in to comment.