Skip to content

Commit

Permalink
fix: cleaning stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
irsyadadl committed Oct 8, 2024
1 parent 1e6af87 commit 68c451e
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,15 @@ export async function init() {
spinner.succeed(`Utils folder already exists at ${utilsFolder}`)
}

// Handle CSS file placement (always overwrite)
const selectedTheme = await selectTheme(cssLocation)

// Determine the target Tailwind config file based on existing files
const tailwindConfigTarget = fs.existsSync('tailwind.config.js') ? 'tailwind.config.js' : 'tailwind.config.ts'

// Check if the config source path exists
if (!fs.existsSync(configSourcePath)) {
spinner.warn(chalk.yellow(`Source Tailwind config file does not exist at ${configSourcePath}`))
return
}

// Copy Tailwind configuration content (always overwrite)
try {
const tailwindConfigContent = fs.readFileSync(configSourcePath, 'utf8')
fs.writeFileSync(tailwindConfigTarget, tailwindConfigContent, { flag: 'w' }) // Overwrite the existing Tailwind config
Expand Down Expand Up @@ -173,7 +169,6 @@ export async function init() {
fs.writeFileSync(path.join(utilsFolder, 'classes.ts'), fileContentClasses, { flag: 'w' })
spinner.succeed(`classes.ts file copied to ${utilsFolder}`)

// Copy theme provider and providers files
if (themeProvider) {
const themeProviderContent = fs.readFileSync(themeProvider, 'utf8')
fs.writeFileSync(path.join(rootFolder, 'theme-provider.tsx'), themeProviderContent, { flag: 'w' })
Expand Down

0 comments on commit 68c451e

Please sign in to comment.