added platform tools download to build as well as generating compiled code
This commit is contained in:
@@ -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]) {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
interface CheckSubmissionResponse {
|
||||
found: boolean;
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user