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))) {
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();
}
@ -179,8 +179,7 @@ async function getDiscordAppPath () {
* 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 discordAppPath = join(discordPath, latestVersionDirectory, 'resources', 'app');
return discordAppPath;
return join(discordPath, latestVersionDirectory, 'resources', 'app');
/**
* Mac
*/
@ -192,8 +191,7 @@ async function getDiscordAppPath () {
return promptManualPathCompletion('inject');
}
const discordAppPath = join(discordPath, 'Contents', 'Resources', 'app');
return discordAppPath;
return join(discordPath, 'Contents', 'Resources', 'app');
}
/**
@ -228,14 +226,12 @@ async function getDiscordAppPath () {
return promptManualPathCompletion('inject');
}
const discordAppPath = join(discordPath, 'resources', 'app');
return discordAppPath;
return join(discordPath, 'resources', 'app');
}
const discordPath = discordProcess[4].split('/');
discordPath.splice(discordPath.length - 1, 1);
const discordAppPath = join('/', ...discordPath, 'resources', 'app');
return discordAppPath;
return join('/', ...discordPath, 'resources', 'app');
}
/**
@ -245,13 +241,13 @@ async function getDiscordAppPath () {
*/
function installDependencies () {
return new Promise((resolve, reject) => {
const command = spawn('npm', [ 'install', '--only=production', '--silent' ], { cwd: join(__dirname, '..', '..', '..'), stdio: 'inherit', shell: true });
command.on('close', () => {
resolve();
});
command.on('error', err => {
reject(err);
const command = spawn('npm', [ 'install', '--only=production', '--silent' ], {
cwd: join(__dirname, '..', '..', '..'),
stdio: 'inherit',
shell: true
});
command.on('close', () => resolve());
command.on('error', err => reject(err));
});
}
@ -471,8 +467,7 @@ async function startInjectionProcess () {
choices: wrapChoicesInColor([
'Discord Stable',
'Discord PTB',
'Discord Canary',
'Discord Development'
'Discord Canary'
])
},
{
@ -484,8 +479,7 @@ async function startInjectionProcess () {
choices: wrapChoicesInColor([
'Discord Stable',
'Discord PTB',
'Discord Canary',
'Discord Development'
'Discord Canary'
])
},
{
@ -497,8 +491,7 @@ async function startInjectionProcess () {
choices: wrapChoicesInColor([
'Discord Stable',
'Discord PTB',
'Discord Canary',
'Discord Development'
'Discord Canary'
])
}
]);
@ -519,9 +512,6 @@ async function startInjectionProcess () {
case release.includes('Canary'):
release = 'Discord Canary';
break;
case release.includes('Development'):
release = 'Discord Development';
break;
}
switch (true) {
case action.includes('Inject'):

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

Loading…
Cancel
Save