Skip to content

Commit f952637

Browse files
committed
append .json if filename passed is not of json type
1 parent acc6c06 commit f952637

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bin/commands/init.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ module.exports = function init(args) {
3838
let path_to_json = get_path(args);
3939
if (path_to_json === undefined) return;
4040

41+
// append .json if filename passed is not of json type
42+
if (path.extname(path_to_json) !== ".json") path_to_json += '.json';
43+
4144
let config = {
4245
file: require('../templates/configTemplate')(),
4346
path: path_to_json

0 commit comments

Comments
 (0)