enso/app/ide-desktop/utils.mjs
Michał Wawrzyniec Urbańczyk 14a01c4635
New IDE build script (#3466)
2022-05-23 04:16:04 +02:00

15 lines
411 B
JavaScript

export function require_env(name) {
return (
process.env[name] ??
(() => {
throw Error(`Missing ${name} environment variable.`)
})()
)
}
export function require_env_path_exist(name) {
const value = require_env(name)
if (path.existsSync(value)) return value
else throw Error(`File with path ${value} read from environment variable ${name} is missing.`)
}