MCPcopy Create free account
hub / github.com/engineer-man/piston / env_vars

Method env_vars

api/src/runtime.js:45–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43 }
44
45 get env_vars() {
46 if (!this._env_vars) {
47 const env_file = path.join(this.pkgdir, '.env');
48 const env_content = fss.read_file_sync(env_file).toString();
49
50 this._env_vars = {};
51
52 env_content
53 .trim()
54 .split('\n')
55 .map(line => line.split('=',2))
56 .forEach(([key,val]) => {
57 this._env_vars[key.trim()] = val.trim();
58 });
59 }
60
61 return this._env_vars;
62 }
63
64 toString() {
65 return `${this.language}-${this.version.raw}`;

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected