This commit is contained in:
Shane Harris
2020-08-17 13:31:48 +01:00
committed by Your Name
parent 270d76ee39
commit 34caadf3b5
3 changed files with 18 additions and 15 deletions
Binary file not shown.
+1 -1
View File
@@ -347,7 +347,7 @@ export class AdbClientService {
} }
async setupAdb() { async setupAdb() {
if (!this.isAdbDownloaded()) { if (!this.isAdbDownloaded()) {
this.appService.seedPlatformTools(); await this.appService.seedPlatformTools();
} }
this.appService.electron.ipcRenderer.on('adb-command', (event, arg: any) => { this.appService.electron.ipcRenderer.on('adb-command', (event, arg: any) => {
if (this.adbResolves[arg.uuid]) { if (this.adbResolves[arg.uuid]) {
+3
View File
@@ -226,6 +226,7 @@ export class AppService {
} }
} }
seedPlatformTools() { seedPlatformTools() {
return new Promise(resolve => {
if (!this.fs.existsSync(this.path.join(this.appData, 'platform-tools'))) { if (!this.fs.existsSync(this.path.join(this.appData, 'platform-tools'))) {
let sourcesPath = this.path.join(__dirname, '..', 'platform-tools'); let sourcesPath = this.path.join(__dirname, '..', 'platform-tools');
if (!this.fs.existsSync(sourcesPath)) { if (!this.fs.existsSync(sourcesPath)) {
@@ -239,9 +240,11 @@ export class AppService {
.createReadStream(this.path.join(sourcesPath, file)) .createReadStream(this.path.join(sourcesPath, file))
.pipe(this.fs.createWriteStream(this.path.join(this.appData, 'platform-tools', file))); .pipe(this.fs.createWriteStream(this.path.join(this.appData, 'platform-tools', file)));
}); });
setTimeout(() => resolve(), 5000);
}); });
}); });
} }
});
} }
makeFolders() { makeFolders() {
return this.mkdir(this.appData) return this.mkdir(this.appData)