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
+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() {