remove discord development from setup options and clean it up a bit

pull/98/head
dperolio 2 years ago
parent 3dd12b99cc
commit 69018610b6
No known key found for this signature in database
GPG Key ID: 4191689562D51409

@ -131,7 +131,7 @@ async function promptManualPathCompletion (action) {
} }
if (!discordAppPath || !(await confirmExistAndHasPermissions(discordAppPath))) { if (!discordAppPath || !(await confirmExistAndHasPermissions(discordAppPath))) {
error(`${release}'s app directory couldn't be located and ${responses.action}ion has been cancelled.`); error(`${release}'s app directory couldn't be located and ${action}ion has been cancelled.`);
return promptForRestartOrExit(); return promptForRestartOrExit();
} }
@ -179,8 +179,7 @@ async function getDiscordAppPath () {
* Get the latest version's folder. Then find and return the app directory path. * Get the latest version's folder. Then find and return the app directory path.
*/ */
const latestVersionDirectory = discordDirectory.filter(path => path.startsWith('app-')).sort().reverse()[0]; const latestVersionDirectory = discordDirectory.filter(path => path.startsWith('app-')).sort().reverse()[0];
const discordAppPath = join(discordPath, latestVersionDirectory, 'resources', 'app'); return join(discordPath, latestVersionDirectory, 'resources', 'app');
return discordAppPath;
/** /**
* Mac * Mac
*/ */
@ -192,8 +191,7 @@ async function getDiscordAppPath () {
return promptManualPathCompletion('inject'); return promptManualPathCompletion('inject');
} }
const discordAppPath = join(discordPath, 'Contents', 'Resources', 'app'); return join(discordPath, 'Contents', 'Resources', 'app');
return discordAppPath;
} }
/** /**
@ -228,14 +226,12 @@ async function getDiscordAppPath () {
return promptManualPathCompletion('inject'); return promptManualPathCompletion('inject');
} }
const discordAppPath = join(discordPath, 'resources', 'app'); return join(discordPath, 'resources', 'app');
return discordAppPath;
} }
const discordPath = discordProcess[4].split('/'); const discordPath = discordProcess[4].split('/');
discordPath.splice(discordPath.length - 1, 1); discordPath.splice(discordPath.length - 1, 1);
const discordAppPath = join('/', ...discordPath, 'resources', 'app'); return join('/', ...discordPath, 'resources', 'app');
return discordAppPath;
} }
/** /**
@ -245,13 +241,13 @@ async function getDiscordAppPath () {
*/ */
function installDependencies () { function installDependencies () {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const command = spawn('npm', [ 'install', '--only=production', '--silent' ], { cwd: join(__dirname, '..', '..', '..'), stdio: 'inherit', shell: true }); const command = spawn('npm', [ 'install', '--only=production', '--silent' ], {
command.on('close', () => { cwd: join(__dirname, '..', '..', '..'),
resolve(); stdio: 'inherit',
}); shell: true
command.on('error', err => {
reject(err);
}); });
command.on('close', () => resolve());
command.on('error', err => reject(err));
}); });
} }
@ -471,8 +467,7 @@ async function startInjectionProcess () {
choices: wrapChoicesInColor([ choices: wrapChoicesInColor([
'Discord Stable', 'Discord Stable',
'Discord PTB', 'Discord PTB',
'Discord Canary', 'Discord Canary'
'Discord Development'
]) ])
}, },
{ {
@ -484,8 +479,7 @@ async function startInjectionProcess () {
choices: wrapChoicesInColor([ choices: wrapChoicesInColor([
'Discord Stable', 'Discord Stable',
'Discord PTB', 'Discord PTB',
'Discord Canary', 'Discord Canary'
'Discord Development'
]) ])
}, },
{ {
@ -497,8 +491,7 @@ async function startInjectionProcess () {
choices: wrapChoicesInColor([ choices: wrapChoicesInColor([
'Discord Stable', 'Discord Stable',
'Discord PTB', 'Discord PTB',
'Discord Canary', 'Discord Canary'
'Discord Development'
]) ])
} }
]); ]);
@ -519,9 +512,6 @@ async function startInjectionProcess () {
case release.includes('Canary'): case release.includes('Canary'):
release = 'Discord Canary'; release = 'Discord Canary';
break; break;
case release.includes('Development'):
release = 'Discord Development';
break;
} }
switch (true) { switch (true) {
case action.includes('Inject'): case action.includes('Inject'):

@ -1,7 +1,7 @@
const TerserPlugin = require('terser-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin');
const { resolve } = require('path'); const { resolve } = require('path');
module.exports = () => ({ module.exports = (_env, _argv) => ({
mode: 'production', mode: 'production',
target: 'node', target: 'node',
entry: './renderer/src/setup/index.js', entry: './renderer/src/setup/index.js',
@ -13,11 +13,14 @@ module.exports = () => ({
extensions: [ '.js' ] extensions: [ '.js' ]
}, },
optimization: { optimization: {
minimize: true,
minimizer: [ minimizer: [
new TerserPlugin({ new TerserPlugin({
extractComments: false, extractComments: false,
terserOptions: { terserOptions: {
keep_classnames: true,
compress: {
drop_debugger: false
},
format: { format: {
comments: false comments: false
} }

Loading…
Cancel
Save