Hopefully fix macos
This commit is contained in:
parent
e8f7c9e8c8
commit
bc753c91d9
2 changed files with 13 additions and 6 deletions
15
preload.js
15
preload.js
|
@ -12,9 +12,16 @@ contextBridge.exposeInMainWorld("installPackage", async (link) => {
|
|||
cwd: packagesPath,
|
||||
})
|
||||
|
||||
await exec("pnpm i --production", {
|
||||
cwd: packagePath,
|
||||
})
|
||||
await exec(
|
||||
`${
|
||||
process.platform == "darwin"
|
||||
? path.join(process.env.HOME, "Library", "pnpm", "pnpm")
|
||||
: "pnpm"
|
||||
} i --production`,
|
||||
{
|
||||
cwd: packagePath,
|
||||
}
|
||||
)
|
||||
|
||||
try {
|
||||
await promises.access(join(packagePath, "main.js"), constants.F_OK)
|
||||
|
@ -26,6 +33,6 @@ contextBridge.exposeInMainWorld("installPackage", async (link) => {
|
|||
return { reloadMessage: "Please reload discord with Ctrl+R" }
|
||||
}
|
||||
} catch (error) {
|
||||
return { errorMessage: error }
|
||||
return { error }
|
||||
}
|
||||
})
|
||||
|
|
Reference in a new issue