Hopefully fix macos
This commit is contained in:
parent
e8f7c9e8c8
commit
bc753c91d9
2 changed files with 13 additions and 6 deletions
13
preload.js
13
preload.js
|
@ -12,9 +12,16 @@ contextBridge.exposeInMainWorld("installPackage", async (link) => {
|
|||
cwd: packagesPath,
|
||||
})
|
||||
|
||||
await exec("pnpm i --production", {
|
||||
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 }
|
||||
}
|
||||
})
|
||||
|
|
|
@ -61,7 +61,7 @@ export default new (class PackageDownloader {
|
|||
onClick: async () => {
|
||||
setDisabled(true)
|
||||
|
||||
const { reloadMessage, errorMessage } =
|
||||
const { reloadMessage, error } =
|
||||
await window.installPackage(gitURL)
|
||||
|
||||
if (reloadMessage) {
|
||||
|
@ -90,7 +90,7 @@ export default new (class PackageDownloader {
|
|||
)
|
||||
)
|
||||
pluginLog(
|
||||
`Package installation failed: ${errorMessage}`,
|
||||
`Package installation failed: ${error}`,
|
||||
console.error
|
||||
)
|
||||
setDisabled(false)
|
||||
|
|
Reference in a new issue