Move updates to the correct location

This commit is contained in:
Samuel Elliott 2019-03-18 22:04:45 +00:00
parent 92334e9a02
commit 586ed01688
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
1 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import semver from 'semver';
import Axi from './axi';
import zlib from 'zlib';
import tarfs from 'tar-fs';
import path from 'path';
const TEST_UPDATE = [
{
@ -91,7 +92,8 @@ export default class Updater extends Module {
async updateBd(update) {
try {
console.log('[BetterDiscord:Updater] Updating', update.id);
await this.downloadTarGz(`https://github.com/JsSucks/BetterDiscordApp${update.remote}`, this.bd.config.getPath('base'));
await this.downloadTarGz(`https://github.com/JsSucks/BetterDiscordApp${update.remote}`, this.bd.config.getPath('tmp'));
await FileUtils.rn(path.join(this.bd.config.getPath('tmp'), update.id), this.bd.config.getPath(update.id));
this.updateFinished(update);
// Cleanup
await FileUtils.rm(`${this.bd.config.getPath(update.id)}_old`);