added log module

This commit is contained in:
2018-05-02 22:05:05 +03:00
parent c89833e80f
commit 3b26ae8b08
9 changed files with 124 additions and 77 deletions

View File

@@ -3,7 +3,7 @@ const fs = require('fs');
const path = require('path');
const run = require('../run/index');
const Sdk = require('./sdk');
const System = Sdk.System;
const Env = require('./env');
class NekoLink {
@@ -56,26 +56,25 @@ class Neko extends Sdk {
}
activate() {
process.env.NEKO_INSTPATH = this.path;
if (process.env.PATH.split(path.delimiter).indexOf(this.path) === -1) {
process.env.PATH = [process.env.PATH, this.path].join(path.delimiter);
}
Env.set('NEKO_INSTPATH', this.path);
Env.addPath(this.path);
Env.addPath(this.path, 'LD_LIBRARY_PATH');
}
get nekoBin() {
let binname = 'neko';
if (os.type() == 'Windows_NT') binname += '.exe';
if (os.type() === 'Windows_NT') binname += '.exe';
return path.join(this.path, binname);
}
run(filename, params) {
this.log.i('_run_ *%s*', filename);
this.activate();
console.log(`${this.nekoBin} ${filename}`);
return run(`${this.nekoBin} ${filename}`, params).exec();
}
}
Neko.ID = 'neko'
Neko.ID = 'neko';
Neko.VERSION_2_2_0 = '2.2.0';
Neko.VERSION = Neko.VERSION_2_2_0;