[build] up haxe version
This commit is contained in:
@@ -28,7 +28,8 @@
|
|||||||
"tmp-file": "^2.0.1",
|
"tmp-file": "^2.0.1",
|
||||||
"unzip-stream": "^0.2.1",
|
"unzip-stream": "^0.2.1",
|
||||||
"vinyl-fs": "^3.0.1",
|
"vinyl-fs": "^3.0.1",
|
||||||
"yargs": "^10.0.3"
|
"yargs": "^10.0.3",
|
||||||
|
"mkdirp": "latest"
|
||||||
},
|
},
|
||||||
"haxeDependencies": {
|
"haxeDependencies": {
|
||||||
"lime": "6.0.1",
|
"lime": "6.0.1",
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class Haxe extends Sdk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get binPath() {
|
get binPath() {
|
||||||
return `${this.path}/haxe-${this.version}`;
|
return `${this.path}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
get haxeBin() {
|
get haxeBin() {
|
||||||
@@ -294,7 +294,8 @@ Haxe.ID = 'haxe';
|
|||||||
Haxe.VERSION_3_4_0 = '3.4.0';
|
Haxe.VERSION_3_4_0 = '3.4.0';
|
||||||
Haxe.VERSION_3_4_2 = '3.4.2';
|
Haxe.VERSION_3_4_2 = '3.4.2';
|
||||||
Haxe.VERSION_3_4_3 = '3.4.3';
|
Haxe.VERSION_3_4_3 = '3.4.3';
|
||||||
Haxe.VERSION_3 = Haxe.VERSION_3_4_2;
|
Haxe.VERSION_3_4_7 = '3.4.7';
|
||||||
|
Haxe.VERSION_3 = Haxe.VERSION_3_4_7;
|
||||||
Haxe.VERSION = Haxe.VERSION_3;
|
Haxe.VERSION = Haxe.VERSION_3;
|
||||||
|
|
||||||
module.exports = Haxe;
|
module.exports = Haxe;
|
||||||
@@ -7,6 +7,7 @@ const tar = require('tar');
|
|||||||
const ProgressBar = require('progress');
|
const ProgressBar = require('progress');
|
||||||
const colors = require('ansi-colors');
|
const colors = require('ansi-colors');
|
||||||
const log = require('fancy-log');
|
const log = require('fancy-log');
|
||||||
|
const mkdirp = require('mkdirp');
|
||||||
|
|
||||||
|
|
||||||
class System {
|
class System {
|
||||||
@@ -79,13 +80,14 @@ class Sdk {
|
|||||||
if (this.prepared) {
|
if (this.prepared) {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
} else {
|
} else {
|
||||||
|
mkdirp(this.path);
|
||||||
const bar = new ProgressBar(`${this.tag} [:bar] :percent :etas`, {width: 40, total: 1000, clear: true});
|
const bar = new ProgressBar(`${this.tag} [:bar] :percent :etas`, {width: 40, total: 1000, clear: true});
|
||||||
let stream = got.stream(this.link);
|
let stream = got.stream(this.link);
|
||||||
stream = stream.on('downloadProgress', (p) => bar.update(p.percent));
|
stream = stream.on('downloadProgress', (p) => bar.update(p.percent));
|
||||||
if (this.link.endsWith('.zip')) {
|
if (this.link.endsWith('.zip')) {
|
||||||
stream = stream.pipe(unzip.Extract({path: this.path}));
|
stream = stream.pipe(unzip.Extract({path: this.path}));
|
||||||
} else if (this.link.endsWith('tar.gz')) {
|
} else if (this.link.endsWith('tar.gz')) {
|
||||||
stream = stream.pipe(tar.x({C: this.path}));
|
stream = stream.pipe(tar.x({C: this.path, strip: 1}));
|
||||||
} else {
|
} else {
|
||||||
stream = stream.pipe(fs.createWriteStream(this.path));
|
stream = stream.pipe(fs.createWriteStream(this.path));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user