fixes
This commit is contained in:
@@ -4,7 +4,6 @@ const fse = require('fs-extra');
|
|||||||
const os = require('os');
|
const os = require('os');
|
||||||
const through = require('through2');
|
const through = require('through2');
|
||||||
const Sdk = require('./sdk');
|
const Sdk = require('./sdk');
|
||||||
const Vinyl = require('vinyl');
|
|
||||||
const run = require('../run/index');
|
const run = require('../run/index');
|
||||||
const {TailVinyl} = require('./tail');
|
const {TailVinyl} = require('./tail');
|
||||||
|
|
||||||
@@ -68,7 +67,7 @@ class FlashPlayer extends Sdk {
|
|||||||
static enableLog() {
|
static enableLog() {
|
||||||
const filename = path.join(os.homedir(), 'mm.cfg');
|
const filename = path.join(os.homedir(), 'mm.cfg');
|
||||||
const value = 'TraceOutputFileEnable=1';
|
const value = 'TraceOutputFileEnable=1';
|
||||||
if (fs.exists(filename)) {
|
if (fs.existsSync(filename)) {
|
||||||
const data = fs.readFileSync(filename);
|
const data = fs.readFileSync(filename);
|
||||||
if (data.indexOf(value) === -1) {
|
if (data.indexOf(value) === -1) {
|
||||||
fs.appendFileSync(filename, `${value}\n`);
|
fs.appendFileSync(filename, `${value}\n`);
|
||||||
@@ -76,18 +75,19 @@ class FlashPlayer extends Sdk {
|
|||||||
} else {
|
} else {
|
||||||
fs.writeFileSync(filename, `${value}\n`);
|
fs.writeFileSync(filename, `${value}\n`);
|
||||||
}
|
}
|
||||||
|
fse.ensureDirSync(path.join(this.flashPlayerDir, 'Logs'));
|
||||||
fs.writeFileSync(FlashPlayer.log, '');
|
fs.writeFileSync(FlashPlayer.log, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
static trust(value) {
|
static trust(value) {
|
||||||
const filename = path.join(this.flashPlayerDir, '#Security', 'FlashPlayerTrust', 'gulp.cfg');
|
const filename = path.join(this.flashPlayerDir, '#Security', 'FlashPlayerTrust', 'gulp.cfg');
|
||||||
if (fs.exists(filename)) {
|
if (fs.existsSync(filename)) {
|
||||||
const data = fs.readFileSync(filename);
|
const data = fs.readFileSync(filename);
|
||||||
if (data.indexOf(value) === -1) {
|
if (data.indexOf(value) === -1) {
|
||||||
fs.appendFileSync(filename, `${value}\n`);
|
fs.appendFileSync(filename, `${value}\n`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!fs.exists(path.dirname(filename))) {
|
if (!fs.existsSync(path.dirname(filename))) {
|
||||||
fse.ensureDirSync(path.dirname(filename));
|
fse.ensureDirSync(path.dirname(filename));
|
||||||
}
|
}
|
||||||
fs.writeFileSync(filename, `${value}\n`);
|
fs.writeFileSync(filename, `${value}\n`);
|
||||||
@@ -117,7 +117,8 @@ FlashPlayer.VERSION_25 = '25';
|
|||||||
FlashPlayer.VERSION_26 = '26';
|
FlashPlayer.VERSION_26 = '26';
|
||||||
FlashPlayer.VERSION_27 = '27';
|
FlashPlayer.VERSION_27 = '27';
|
||||||
FlashPlayer.VERSION_29 = '29';
|
FlashPlayer.VERSION_29 = '29';
|
||||||
|
FlashPlayer.VERSION_30 = '30';
|
||||||
|
|
||||||
FlashPlayer.VERSION = FlashPlayer.VERSION_29;
|
FlashPlayer.VERSION = FlashPlayer.VERSION_30;
|
||||||
|
|
||||||
module.exports = FlashPlayer;
|
module.exports = FlashPlayer;
|
||||||
@@ -81,6 +81,7 @@ class Sdk {
|
|||||||
} else {
|
} else {
|
||||||
fse.ensureDirSync(this.path);
|
fse.ensureDirSync(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});
|
||||||
|
this.log.d('download: *%s*', this.link);
|
||||||
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')) {
|
||||||
|
|||||||
@@ -11,13 +11,17 @@ class TailVinyl extends Vinyl {
|
|||||||
constructor(params) {
|
constructor(params) {
|
||||||
params.contents = new Transform();
|
params.contents = new Transform();
|
||||||
super(params);
|
super(params);
|
||||||
this.tail = new Tail(params.path);
|
if (params.path) {
|
||||||
this.tail.on('line', data => this.contents.write(data + '\n'));
|
this.tail = new Tail(params.path);
|
||||||
this.tail.on('error', error => this.contents.write('error: ' + error));
|
this.tail.on('line', data => this.contents.write(data + '\n'));
|
||||||
|
this.tail.on('error', error => this.contents.write('error: ' + error));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose() {
|
dispose() {
|
||||||
this.tail.unwatch();
|
if (this.tail) {
|
||||||
|
this.tail.unwatch();
|
||||||
|
}
|
||||||
this.contents.destroy();
|
this.contents.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gulp-haxetool",
|
"name": "gulp-haxetool",
|
||||||
"version": "0.0.12",
|
"version": "0.0.13",
|
||||||
"description": "HaXe Tool for Gulp",
|
"description": "HaXe Tool for Gulp",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
Reference in New Issue
Block a user