Fix packed plugins
This commit is contained in:
parent
47575d3449
commit
82e9b0bd6a
|
@ -84,15 +84,10 @@ export default class PackageInstaller {
|
|||
|
||||
await oldContent.unload(true);
|
||||
|
||||
if (oldContent.packed && oldContent.packed.packageName !== nameOrId) {
|
||||
rimraf(oldContent.packed.packagePath, err => {
|
||||
if (err) throw err;
|
||||
});
|
||||
} else {
|
||||
rimraf(oldContent.contentPath, err => {
|
||||
if (err) throw err;
|
||||
});
|
||||
if (oldContent.packed && oldContent.packageName !== nameOrId) {
|
||||
await FileUtils.deleteFile(oldContent.packagePath).catch(err => null);
|
||||
}
|
||||
await FileUtils.recursiveDeleteDirectory(oldContent.contentPath).catch(err => null);
|
||||
|
||||
return manager.preloadPackedContent(outputName);
|
||||
} catch (err) {
|
||||
|
|
|
@ -109,21 +109,9 @@ export default class extends ContentManager {
|
|||
throw {message: `Plugin ${info.name} did not return a class that extends Plugin.`};
|
||||
|
||||
const instance = new plugin({
|
||||
configs, info, main,
|
||||
paths: {
|
||||
contentPath: paths.contentPath,
|
||||
dirName: packed ? packed.packageName : paths.dirName,
|
||||
mainPath: paths.mainPath
|
||||
}
|
||||
configs, info, main, paths
|
||||
});
|
||||
|
||||
if (packed) instance.packed = {
|
||||
pkg: packed.pkg,
|
||||
packageName: packed.packageName,
|
||||
packagePath: packed.packagePath,
|
||||
packed: true
|
||||
}; else instance.packed = false;
|
||||
|
||||
if (instance.enabled && this.loaded) {
|
||||
instance.userConfig.enabled = false;
|
||||
instance.start(false);
|
||||
|
|
|
@ -36,12 +36,7 @@ export default class ThemeManager extends ContentManager {
|
|||
static async loadTheme(paths, configs, info, main) {
|
||||
try {
|
||||
const instance = new Theme({
|
||||
configs, info, main,
|
||||
paths: {
|
||||
contentPath: paths.contentPath,
|
||||
dirName: paths.dirName,
|
||||
mainPath: paths.mainPath
|
||||
}
|
||||
configs, info, main, paths
|
||||
});
|
||||
if (instance.enabled) {
|
||||
instance.userConfig.enabled = false;
|
||||
|
|
Loading…
Reference in New Issue