added platform tools download to build as well as generating compiled code

This commit is contained in:
Shane Harris
2020-08-17 13:31:48 +01:00
committed by Your Name
parent e0f647c7eb
commit 1996fa3c6d
9 changed files with 84 additions and 17 deletions
+1 -1
View File
@@ -347,7 +347,7 @@ export class AdbClientService {
}
async setupAdb() {
if (!this.isAdbDownloaded()) {
await this.downloadTools();
this.appService.seedPlatformTools();
}
this.appService.electron.ipcRenderer.on('adb-command', (event, arg: any) => {
if (this.adbResolves[arg.uuid]) {
+11 -5
View File
@@ -225,13 +225,19 @@ export class AppService {
break;
}
}
seedSources() {
if (!this.fs.existsSync(this.path.join(this.appData, 'sources.txt'))) {
let sourcesPath = this.path.join(__dirname, 'assets', 'sources.txt');
seedPlatformTools() {
if (!this.fs.existsSync(this.path.join(this.appData, 'platform-tools'))) {
let sourcesPath = this.path.join(__dirname, 'platform-tools');
if (!this.fs.existsSync(sourcesPath)) {
sourcesPath = this.path.join(process.cwd(), 'desktop-app', 'src', 'assets', 'sources.txt');
sourcesPath = this.path.join(process.cwd(), 'build', 'platform-tools');
}
this.fs.createReadStream(sourcesPath).pipe(this.fs.createWriteStream(this.path.join(this.appData, 'sources.txt')));
this.fs.readdir(sourcesPath, (err, files) => {
files.forEach(file => {
this.fs
.createReadStream(this.path.join(sourcesPath, file))
.pipe(this.fs.createWriteStream(this.path.join(this.appData, file)));
});
});
}
}
makeFolders() {
-4
View File
@@ -1,9 +1,5 @@
import { Injectable } from '@angular/core';
interface CheckSubmissionResponse {
found: boolean;
}
@Injectable({
providedIn: 'root',
})