[haxe,flashplayer] fixes

This commit is contained in:
2018-04-03 17:02:14 +03:00
parent f5cfd50537
commit 8c5179fdb5
3 changed files with 25 additions and 42 deletions

View File

@@ -3,12 +3,12 @@ const fs = require('fs');
const fse = require('fs-extra');
const os = require('os');
const through = require('through2');
const gulp = require('gulp');
const Sdk = require('./sdk');
const exec = require('./exec');
const PluginError = require('plugin-error');
const colors = require('ansi-colors');
const log = require('fancy-log');
const tar = require('tar');
class FlashPlayer extends Sdk {
@@ -18,9 +18,7 @@ class FlashPlayer extends Sdk {
}
playerPath(debug) {
const v = this.version.split('.');
const dir = `${v[0]}_${v[1]}_r${v[2]}_${v[3]}`;
return `${this.path}/${dir}${debug ? '_debug': ''}`;
return this.path;
}
prepare() {
@@ -34,13 +32,11 @@ class FlashPlayer extends Sdk {
const extract = (debug) => {
const v = this.version.split('.');
const playerPath = this.playerPath(debug);
// ToDo: fix
const archive = `${playerPath}/flashplayer${v[0]}_${v[1]}r${v[2]}_${v[3]}_linux_sa${debug ? '_debug' : ''}.${arch}.tar.gz`;
return gulp.src(archive)
.pipe(gunzip()).pipe(untar())
.pipe(gulp.dest(playerPath));
return fs.createReadStream(archive).pipe(tar.x({C: this.path}));
};
// ToDo:
return new Promise((success, fail) => {
extract().on('end', () => {
extract(true).on('end', success).on('error', fail)