cli: use camelCase for theme

This commit is contained in:
Benjamin Canac
2024-03-19 14:21:30 +01:00
parent f46f8327c4
commit 1cec712fb8
2 changed files with 5 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ import { existsSync, promises as fsp } from 'node:fs'
import { resolve } from 'pathe'
import { defineCommand } from 'citty'
import { consola } from 'consola'
import { camelCase, kebabCase } from 'scule'
import { camelCase } from 'scule'
import templates from '../utils/templates.mjs'
export default defineCommand({
@@ -42,7 +42,7 @@ export default defineCommand({
const themePath = resolve(path, 'src/theme/index.ts')
const theme = await fsp.readFile(themePath, 'utf-8')
const contents = `export { default as ${camelCase(name)} } from './${kebabCase(name)}'`
const contents = `export { default as ${camelCase(name)} } from './${camelCase(name)}'`
if (!theme.includes(contents)) {
await fsp.writeFile(themePath, theme.trim() + '\n' + contents + '\n')
}