Skip to content

Commit

Permalink
feat: add hashbang to bin script
Browse files Browse the repository at this point in the history
  • Loading branch information
khoilen committed Dec 18, 2024
1 parent 9e61dab commit a79c78a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
41 changes: 18 additions & 23 deletions apps/nt-stylesheet/bin/init-tailwind.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/env node

import fs from 'fs'
import readline from 'readline'

// Check if running in an interactive environment
const isInteractive = process.stdout.isTTY

const createTailwindConfig = () => {
const tailwindConfigContent = `/** @type {import('tailwindcss').Config} */
const ntTheme = require('nt-stylesheet/dist/theme.cjs');
Expand Down Expand Up @@ -60,24 +59,20 @@ const createPostCSSConfig = () => {
)
}

if (isInteractive) {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
})
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
})

rl.question(
'Do you want to initialize Tailwind CSS? (y/n) ',
(answer) => {
if (answer.toLowerCase() === 'y') {
createTailwindConfig()
createPostCSSConfig()
} else {
console.log('Tailwind CSS initialization skipped.')
}
rl.close()
},
)
} else {
console.log('Non-interactive mode detected.')
}
rl.question(
'Do you want to initialize Tailwind CSS? (y/n) ',
(answer) => {
if (answer.toLowerCase() === 'y') {
createTailwindConfig()
createPostCSSConfig()
} else {
console.log('Tailwind CSS initialization skipped.')
}
rl.close()
},
)
2 changes: 1 addition & 1 deletion apps/nt-stylesheet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nt-stylesheet",
"version": "1.1.6",
"version": "1.1.7",
"description": "",
"packageManager": "[email protected]",
"scripts": {
Expand Down

0 comments on commit a79c78a

Please sign in to comment.