fix(create-bot): git setup
also im retarded and forgot to include prettier in deps
This commit is contained in:
parent
52773a6cb5
commit
528cc4dc92
2 changed files with 16 additions and 0 deletions
|
@ -31,6 +31,7 @@ export function buildDependenciesList(config: UserConfig) {
|
|||
'eslint-plugin-ascii',
|
||||
'eslint-plugin-import',
|
||||
'eslint-plugin-simple-import-sort',
|
||||
'prettier',
|
||||
)
|
||||
|
||||
if (config.features.includes(MtcuteFeature.TypeScript)) {
|
||||
|
|
|
@ -3,7 +3,9 @@ import { join } from 'node:path'
|
|||
|
||||
import { askForConfig } from './cli.js'
|
||||
import { installDependencies } from './dependencies.js'
|
||||
import { MtcuteFeature } from './features/types.js'
|
||||
import { runTemplater } from './templater.js'
|
||||
import { exec } from './utils.js'
|
||||
|
||||
const projectName = process.argv[2]
|
||||
|
||||
|
@ -22,6 +24,19 @@ await runTemplater(join(__dirname, '../template'), outDir, config)
|
|||
|
||||
await installDependencies(outDir, config)
|
||||
|
||||
await exec(outDir, 'git', 'init')
|
||||
|
||||
if (config.features.includes(MtcuteFeature.Linters)) {
|
||||
if (process.platform === 'win32') {
|
||||
// windows doesn't track executable bit, but git does
|
||||
await exec(outDir, 'git', 'update-index', '--chmod=+x', '.husky/pre-commit')
|
||||
} else {
|
||||
await exec(outDir, 'chmod', '+x', '.husky/pre-commit')
|
||||
}
|
||||
|
||||
await exec(outDir, 'pnpm', 'exec', 'husky', 'install')
|
||||
}
|
||||
|
||||
console.log(`✅ Scaffolded new project at ${chalk.blue(outDir)}`)
|
||||
console.log('🚀 Run it with:')
|
||||
console.log(` ${chalk.blue('$')} cd ${projectName}`)
|
||||
|
|
Loading…
Reference in a new issue