Fix inject script for Canary on Linux

This commit is contained in:
Samuel Elliott 2018-11-25 01:04:07 +00:00
parent 4af09224d7
commit 572721c57f
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
1 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ console.log(`Injecting into version ${release}`);
const discordPath = (function() {
if (process.platform === 'win32') {
const basedir = path.join(process.env.LOCALAPPDATA, release);
const basedir = path.join(process.env.LOCALAPPDATA, release.replace(/ /g, ''));
if (!fs.existsSync(basedir)) throw new Error(`Cannot find directory for ${release}`);
const version = fs.readdirSync(basedir).filter(f => fs.lstatSync(path.join(basedir, f)).isDirectory() && f.split('.').length > 1).sort().reverse()[0];
return path.join(basedir, version, 'resources');
@ -21,7 +21,7 @@ const discordPath = (function() {
return path.join(appPath, 'Contents', 'Resources');
} else if (process.platform === 'linux') {
return path.join('/usr', 'share', release.toLowerCase(), 'resources');
return path.join('/usr', 'share', release.toLowerCase().replace(/ /g, '-'), 'resources');
}
})();