mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-26 13:46:05 +02:00
simplify installer and remove parsing from read config
This commit is contained in:
parent
9f38ad9b4d
commit
ead5df0a8c
9 changed files with 51 additions and 70 deletions
|
@ -233,24 +233,11 @@ export function readConfigFile() {
|
|||
environment = loadConfig(configFilePath2);
|
||||
}
|
||||
|
||||
if (process.env.APP_BASE_DOMAIN) {
|
||||
console.log(
|
||||
"You're using deprecated environment variables. Transition to the configuration file. https://docs.fossorial.io/"
|
||||
);
|
||||
}
|
||||
|
||||
if (!environment) {
|
||||
throw new Error(
|
||||
"No configuration file found. Please create one. https://docs.fossorial.io/"
|
||||
);
|
||||
}
|
||||
|
||||
const parsedConfig = configSchema.safeParse(environment);
|
||||
|
||||
if (!parsedConfig.success) {
|
||||
const errors = fromError(parsedConfig.error);
|
||||
throw new Error(`Invalid configuration file: ${errors}`);
|
||||
}
|
||||
|
||||
return parsedConfig.data;
|
||||
return environment;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue