added support for scrcpy to linux and mac builds

This commit is contained in:
Shane Harris
2020-08-17 13:31:48 +01:00
committed by Your Name
parent 86b6e627d2
commit eb9b88123a
4 changed files with 22 additions and 7 deletions
+21 -1
View File
@@ -300,7 +300,7 @@ export class AppService {
return `${packageString} ${nodeString} ${computerString}`;
}
runScrCpy(options: any) {
startScrCpy(options: any) {
return new Promise((resolve, reject) => {
let command =
'"' +
@@ -329,6 +329,24 @@ export class AppService {
});
}
runScrCpy(options: any) {
let platform = this.os.platform();
if (platform === 'linux' || platform === 'darwin') {
return new Promise((resolve, reject) => {
this.exec('scrcpy -v', (err, stdout, stderr) => {
if (err) {
return reject(err);
}
this.startScrCpy(options)
.then(resolve)
.catch(reject);
});
});
} else {
return this.startScrCpy(options);
}
}
downloadScrCpyBinary() {
if (this.os.platform() === 'win32') {
this.spinnerService.showLoader();
@@ -364,6 +382,8 @@ export class AppService {
this.scrcpyBinaryPath = downloadPath;
});
});
} else {
this.scrcpyBinaryPath = 'scrcpy';
}
}
deleteFolderRecursive(path) {