mirror of
https://github.com/ragestudio/relic.git
synced 2025-06-09 02:24:18 +00:00
support import_libs
This commit is contained in:
parent
63f247a5ac
commit
48fea3bc18
@ -1,6 +1,20 @@
|
||||
import path from "node:path"
|
||||
import os from "node:os"
|
||||
|
||||
import PublicLibs from "../public_libraries"
|
||||
|
||||
async function importLib(libs) {
|
||||
const libraries = {}
|
||||
|
||||
for (const lib of libs) {
|
||||
if (PublicLibs[lib]) {
|
||||
libraries[lib] = PublicLibs[lib]
|
||||
}
|
||||
}
|
||||
|
||||
return libraries
|
||||
}
|
||||
|
||||
export default async (manifest = {}) => {
|
||||
const packPath = path.resolve(INSTALLERS_PATH, manifest.id)
|
||||
|
||||
@ -21,6 +35,11 @@ export default async (manifest = {}) => {
|
||||
delete manifest.init
|
||||
}
|
||||
|
||||
if (Array.isArray(manifest.import_libs)) {
|
||||
manifest.libraries = await importLib(manifest.import_libs)
|
||||
console.log(`Imported libraries: ${manifest.import_libs.join(", ")}`)
|
||||
}
|
||||
|
||||
return {
|
||||
...manifest,
|
||||
packPath: packPath,
|
||||
|
Loading…
x
Reference in New Issue
Block a user