mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
fix cases where configurations are empty
This commit is contained in:
parent
d66326b41d
commit
3882dd4f5a
@ -15,6 +15,10 @@ export async function servicesFromConfig() {
|
||||
const fileContents = await fs.readFile(servicesYaml, "utf8");
|
||||
const services = yaml.load(fileContents);
|
||||
|
||||
if (!services) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// map easy to write YAML objects into easy to consume JS arrays
|
||||
const servicesArray = services.map((servicesGroup) => ({
|
||||
name: Object.keys(servicesGroup)[0],
|
||||
@ -34,6 +38,10 @@ export async function servicesFromDocker() {
|
||||
const dockerFileContents = await fs.readFile(dockerYaml, "utf8");
|
||||
const servers = yaml.load(dockerFileContents);
|
||||
|
||||
if (!servers) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const serviceServers = await Promise.all(
|
||||
Object.keys(servers).map(async (serverName) => {
|
||||
const docker = new Docker(getDockerArguments(serverName));
|
||||
|
Loading…
x
Reference in New Issue
Block a user