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,