Files
gulp-haxetool/src/common/env.ts
T

20 lines
458 B
TypeScript
Executable File

import path from "path";
export class Env {
static set(key: string, value: string) {
process.env[key] = value;
}
static get(key: string) {
return process.env[key];
}
static addPath(value: string, 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);
}
}
}