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

20
haxetool/env.js Normal file
View File

@@ -0,0 +1,20 @@
const path = require('path');
class Env {
static set(key, value) {
process.env[key] = value;
}
static addPath(value, key='PATH') {
if (!process.env[key]) {
process.env[key] = value;
} else if (process.env[key].split(path.delimiter).indexOf(value) === -1) {
process.env[key] = [process.env[key], value].join(path.delimiter);
}
}
}
module.exports = Env;