From e9212a889d4d5be41f00f1452f98d23122893a66 Mon Sep 17 00:00:00 2001 From: shmyga Date: Wed, 7 Mar 2018 17:17:02 +0300 Subject: [PATCH] [build] up haxe version --- package.json | 3 ++- tasks/haxe.js | 5 +++-- tasks/sdk.js | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7b73b00..a09716d 100755 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "tmp-file": "^2.0.1", "unzip-stream": "^0.2.1", "vinyl-fs": "^3.0.1", - "yargs": "^10.0.3" + "yargs": "^10.0.3", + "mkdirp": "latest" }, "haxeDependencies": { "lime": "6.0.1", diff --git a/tasks/haxe.js b/tasks/haxe.js index 10c2af9..26f6d88 100755 --- a/tasks/haxe.js +++ b/tasks/haxe.js @@ -28,7 +28,7 @@ class Haxe extends Sdk { } get binPath() { - return `${this.path}/haxe-${this.version}`; + return `${this.path}`; } get haxeBin() { @@ -294,7 +294,8 @@ Haxe.ID = 'haxe'; Haxe.VERSION_3_4_0 = '3.4.0'; Haxe.VERSION_3_4_2 = '3.4.2'; 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; module.exports = Haxe; \ No newline at end of file diff --git a/tasks/sdk.js b/tasks/sdk.js index 00fffb2..5d36628 100755 --- a/tasks/sdk.js +++ b/tasks/sdk.js @@ -7,6 +7,7 @@ const tar = require('tar'); const ProgressBar = require('progress'); const colors = require('ansi-colors'); const log = require('fancy-log'); +const mkdirp = require('mkdirp'); class System { @@ -79,13 +80,14 @@ class Sdk { if (this.prepared) { return Promise.resolve(); } else { + mkdirp(this.path); const bar = new ProgressBar(`${this.tag} [:bar] :percent :etas`, {width: 40, total: 1000, clear: true}); let stream = got.stream(this.link); stream = stream.on('downloadProgress', (p) => bar.update(p.percent)); if (this.link.endsWith('.zip')) { stream = stream.pipe(unzip.Extract({path: this.path})); } 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 { stream = stream.pipe(fs.createWriteStream(this.path)); }