This commit is contained in:
2018-07-07 16:30:57 +03:00
parent 820b639427
commit 54830d1d01
4 changed files with 16 additions and 10 deletions

View File

@@ -4,7 +4,6 @@ const fse = require('fs-extra');
const os = require('os');
const through = require('through2');
const Sdk = require('./sdk');
const Vinyl = require('vinyl');
const run = require('../run/index');
const {TailVinyl} = require('./tail');
@@ -68,7 +67,7 @@ class FlashPlayer extends Sdk {
static enableLog() {
const filename = path.join(os.homedir(), 'mm.cfg');
const value = 'TraceOutputFileEnable=1';
if (fs.exists(filename)) {
if (fs.existsSync(filename)) {
const data = fs.readFileSync(filename);
if (data.indexOf(value) === -1) {
fs.appendFileSync(filename, `${value}\n`);
@@ -76,18 +75,19 @@ class FlashPlayer extends Sdk {
} else {
fs.writeFileSync(filename, `${value}\n`);
}
fse.ensureDirSync(path.join(this.flashPlayerDir, 'Logs'));
fs.writeFileSync(FlashPlayer.log, '');
}
static trust(value) {
const filename = path.join(this.flashPlayerDir, '#Security', 'FlashPlayerTrust', 'gulp.cfg');
if (fs.exists(filename)) {
if (fs.existsSync(filename)) {
const data = fs.readFileSync(filename);
if (data.indexOf(value) === -1) {
fs.appendFileSync(filename, `${value}\n`);
}
} else {
if (!fs.exists(path.dirname(filename))) {
if (!fs.existsSync(path.dirname(filename))) {
fse.ensureDirSync(path.dirname(filename));
}
fs.writeFileSync(filename, `${value}\n`);
@@ -117,7 +117,8 @@ FlashPlayer.VERSION_25 = '25';
FlashPlayer.VERSION_26 = '26';
FlashPlayer.VERSION_27 = '27';
FlashPlayer.VERSION_29 = '29';
FlashPlayer.VERSION_30 = '30';
FlashPlayer.VERSION = FlashPlayer.VERSION_29;
FlashPlayer.VERSION = FlashPlayer.VERSION_30;
module.exports = FlashPlayer;