diff --git a/client/src/modules/contentmanager.js b/client/src/modules/contentmanager.js index 7a0076bb..c50c88f7 100644 --- a/client/src/modules/contentmanager.js +++ b/client/src/modules/contentmanager.js @@ -12,6 +12,7 @@ import asar from 'asar'; import path, { dirname } from 'path'; import rimraf from 'rimraf'; +import { remote } from 'electron'; import Content from './content'; import Globals from './globals'; import Database from './database'; @@ -71,6 +72,28 @@ export default class { return Globals.getPath(this.pathId); } + static async packContent(path, contentPath) { + return new Promise((resolve, reject) => { + remote.dialog.showSaveDialog({ + title: 'Save Package', + defaultPath: path, + filters: [ + { + name: 'BetterDiscord Package', + extensions: ['bd'] + } + ] + }, filepath => { + if (!filepath) return; + + asar.uncache(filepath); + asar.createPackage(contentPath, filepath, () => { + resolve(filepath); + }); + }); + }); + } + /** * Load all locally stored content. * @param {bool} suppressErrors Suppress any errors that occur during loading of content diff --git a/client/src/ui/components/bd/PluginCard.vue b/client/src/ui/components/bd/PluginCard.vue index f8cfe65d..3a485936 100644 --- a/client/src/ui/components/bd/PluginCard.vue +++ b/client/src/ui/components/bd/PluginCard.vue @@ -23,11 +23,8 @@