mirror of
https://github.com/ragestudio/relic.git
synced 2025-06-09 02:24:18 +00:00
try to pre-contextualize with db
This commit is contained in:
parent
d9e9772d24
commit
2789b30051
@ -3,6 +3,8 @@ import Logger from "../logger"
|
|||||||
import os from "node:os"
|
import os from "node:os"
|
||||||
import vm from "node:vm"
|
import vm from "node:vm"
|
||||||
import path from "node:path"
|
import path from "node:path"
|
||||||
|
|
||||||
|
import DB from "../db"
|
||||||
import ManifestConfigManager from "../classes/ManifestConfig"
|
import ManifestConfigManager from "../classes/ManifestConfig"
|
||||||
|
|
||||||
import resolveOs from "../utils/resolveOs"
|
import resolveOs from "../utils/resolveOs"
|
||||||
@ -13,10 +15,20 @@ import Settings from "../classes/Settings"
|
|||||||
import Vars from "../vars"
|
import Vars from "../vars"
|
||||||
|
|
||||||
async function BuildManifest(baseClass, context, { soft = false } = {}) {
|
async function BuildManifest(baseClass, context, { soft = false } = {}) {
|
||||||
const packagesPath = await Settings.get("packages_path") ?? Vars.packages_path
|
// try to find install_path on db
|
||||||
|
const pkg = await DB.getPackages(baseClass.id)
|
||||||
// inject install_path
|
|
||||||
context.install_path = path.resolve(packagesPath, baseClass.id)
|
if (pkg) {
|
||||||
|
if (pkg.install_path) {
|
||||||
|
context.install_path = pkg.install_path
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const packagesPath = await Settings.get("packages_path") ?? Vars.packages_path
|
||||||
|
|
||||||
|
// inject install_path
|
||||||
|
context.install_path = path.resolve(packagesPath, baseClass.id)
|
||||||
|
}
|
||||||
|
|
||||||
baseClass.install_path = context.install_path
|
baseClass.install_path = context.install_path
|
||||||
|
|
||||||
if (soft === true) {
|
if (soft === true) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user