latest
This commit is contained in:
Binary file not shown.
@@ -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]) {
|
||||||
|
|||||||
@@ -226,22 +226,25 @@ export class AppService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
seedPlatformTools() {
|
seedPlatformTools() {
|
||||||
if (!this.fs.existsSync(this.path.join(this.appData, 'platform-tools'))) {
|
return new Promise(resolve => {
|
||||||
let sourcesPath = this.path.join(__dirname, '..', 'platform-tools');
|
if (!this.fs.existsSync(this.path.join(this.appData, 'platform-tools'))) {
|
||||||
if (!this.fs.existsSync(sourcesPath)) {
|
let sourcesPath = this.path.join(__dirname, '..', 'platform-tools');
|
||||||
sourcesPath = this.path.join(process.cwd(), 'build', 'platform-tools');
|
if (!this.fs.existsSync(sourcesPath)) {
|
||||||
}
|
sourcesPath = this.path.join(process.cwd(), 'build', 'platform-tools');
|
||||||
console.log(this.path.join(__dirname, '..', 'platform-tools'), process.cwd(), __dirname);
|
}
|
||||||
this.fs.mkdir(this.path.join(this.appData, 'platform-tools'), () => {
|
console.log(this.path.join(__dirname, '..', 'platform-tools'), process.cwd(), __dirname);
|
||||||
this.fs.readdir(sourcesPath, (err, files) => {
|
this.fs.mkdir(this.path.join(this.appData, 'platform-tools'), () => {
|
||||||
files.forEach(file => {
|
this.fs.readdir(sourcesPath, (err, files) => {
|
||||||
this.fs
|
files.forEach(file => {
|
||||||
.createReadStream(this.path.join(sourcesPath, file))
|
this.fs
|
||||||
.pipe(this.fs.createWriteStream(this.path.join(this.appData, 'platform-tools', file)));
|
.createReadStream(this.path.join(sourcesPath, 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)
|
||||||
|
|||||||
Reference in New Issue
Block a user