-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b9bdd0
commit 4bca19b
Showing
1 changed file
with
17 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
export default function compileFilamentList() { | ||
const filament = import.meta.glob('../../profiles/filaments/*.json'); | ||
return Promise.all(Object.keys(filament).map(async (key) => { | ||
const profile = await filament[key](); | ||
return { | ||
"name": profile.name.replace("-OpenNept4une", ""), | ||
"identifier": profile.name, | ||
"profile": profile | ||
} | ||
})); | ||
} | ||
export default async function compileFilamentList() { | ||
try { | ||
const filaments = import.meta.glob('../../profiles/filaments/*.json'); | ||
const filamentList = await Promise.all(Object.keys(filaments).map(async (key) => { | ||
const profile = await filaments[key](); | ||
return { | ||
name: profile.name.replace("-OpenNept4une", ""), | ||
identifier: key.split('/').pop().replace('.json', ''), // Use the file name without the extension as identifier | ||
profile: profile | ||
}; | ||
})); | ||
return filamentList; | ||
} catch (error) { | ||
console.error("Error compiling filament list:", error); | ||
throw error; | ||
} | ||
} |