Add validation to env vars

This commit is contained in:
Brahim Hadriche committed 2023-07-10 09:15:21 -04:00
1 parent e5a932f62f
commit 6ac8d54144
2 files changed
+10

No files matched your search

+5
View File
@@ -19,6 +19,11 @@ const args = parser.parse_args()
const filename = args.filename;
const config = getEnvVars();
['ROKU_DEV_TARGET', 'ROKU_DEVPASSWORD'].forEach((key) => {
if (!config[key]) {
throw new Error(`Missing environment variable ${key}`);
}
});
const options = {
host: config.ROKU_DEV_TARGET,
+5
View File
@@ -5,6 +5,11 @@ const getEnvVars = require('./get-env-vars');
const rokuDeploy = require('roku-deploy');
const config = getEnvVars();
['ROKU_DEV_TARGET', 'ROKU_DEVPASSWORD', 'ROKU_SIGN_PASSWORD'].forEach((key) => {
if (!config[key]) {
throw new Error(`Missing environment variable ${key}`);
}
});
const options = {
host: config.ROKU_DEV_TARGET,