Skip to content

Commit

Permalink
fix: template branch cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
schettn committed Jul 11, 2024
1 parent b067717 commit baba43e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/pylon-cli/src/commands/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default async (

logger.info(`🚀 Starting project creation: ${name}`)
logger.info(`📁 Destination: ${rootPath}`)
logger.info(`🔖 Template: ${template.url}`, {
logger.info(`🔖 Template: ${template.url} on branch ${template.branch}`, {
template
})

Expand Down Expand Up @@ -60,9 +60,16 @@ export default async (

// Clone the template repository into the project directory
logger.info(`Cloning template from ${template.url} into ${projectDir}`)
await Bun.$`git clone ${template.branch ? `-b ${template.branch}` : ''} ${
template.url
} "${projectDir}" --single-branch`

Bun.spawnSync([
'git',
'clone',
template.branch ? '-b' : '',
template.branch || '',
template.url,
projectDir,
'--single-branch'
])

// Remove the .git directory from the project directory
logger.info('Removing existing .git directory')
Expand Down

0 comments on commit baba43e

Please sign in to comment.