convert-json-env
Advanced tools
Comparing version 1.1.0 to 1.1.1
11
index.js
@@ -26,2 +26,8 @@ #!/usr/bin/env node | ||
const inputFile = args._[0]; | ||
if (!inputFile) { | ||
console.log('❌ Invalid usage. Try `convert-json-env --help` for help.'); | ||
return; | ||
} | ||
const inputFileExt = inputFile.split('.').slice(-1)[0]; | ||
@@ -33,6 +39,3 @@ const inputFileStem = inputFile.split('.').slice(0, -1).join(); | ||
if (!inputFile) { | ||
console.log('Invalid usage. Try `convert-json-env --help` for help.'); | ||
return; | ||
} else if (inputFileExt !== 'json') { | ||
if (inputFileExt !== 'json') { | ||
console.log( | ||
@@ -39,0 +42,0 @@ '❌ This file is not *.json. Try `convert-json-env --help` for help.'); |
{ | ||
"name": "convert-json-env", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A CLI tool for converting JSON to env file.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -67,11 +67,11 @@ # convert-json-env | ||
```sh | ||
$ convert-json-env example-firebaseConfig.json --prefix=VUE_APP_ --embed | ||
$ convert-json-env firebaseConfig.json --prefix=process.env.VUE_APP_ --embed | ||
{ | ||
apiKey: VUE_APP_apiKey, | ||
authDomain: VUE_APP_authDomain, | ||
databaseURL: VUE_APP_databaseURL, | ||
projectId: VUE_APP_projectId, | ||
storageBucket: VUE_APP_storageBucket, | ||
messagingSenderId: VUE_APP_messagingSenderId, | ||
appId: VUE_APP_appId | ||
apiKey: process.env.VUE_APP_apiKey, | ||
authDomain: process.env.VUE_APP_authDomain, | ||
databaseURL: process.env.VUE_APP_databaseURL, | ||
projectId: process.env.VUE_APP_projectId, | ||
storageBucket: process.env.VUE_APP_storageBucket, | ||
messagingSenderId: process.env.VUE_APP_messagingSenderId, | ||
appId: process.env.VUE_APP_appId | ||
} | ||
@@ -78,0 +78,0 @@ ``` |
6730
59