Skip to content

Commit 9eda1e9

Browse files
authored
Merge pull request #104 from lkmadushan/append-file-extension
Add file extension if not exists
2 parents a46c460 + 0c5ad51 commit 9eda1e9

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)