Skip to content

Commit 0c5ad51

Browse files
committed
Add file extension if not exists
1 parent a46c460 commit 0c5ad51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cli.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ program.version(packageJson.version).usage('<command> [<args>]')
5353
program.command('init [filename]')
5454
.usage('[options] [filename]')
5555
.action(function (filename = 'tailwind.js') {
56-
const destination = path.resolve(filename)
56+
let destination = path.resolve(filename)
57+
58+
if (! path.extname(filename).includes('.js')) {
59+
destination += '.js'
60+
}
5761

5862
if (fs.existsSync(destination)) {
5963
console.log(`Destination ${destination} already exists, aborting.`)

0 commit comments

Comments
 (0)