snapshot of https://github.com/excalidraw/excalidraw.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Tests / test (push) Failing after 15s
Some checks failed
Tests / test (push) Failing after 15s
This commit is contained in:
19
packages/excalidraw/env.cjs
Normal file
19
packages/excalidraw/env.cjs
Normal file
@@ -0,0 +1,19 @@
|
||||
const dotenv = require("dotenv");
|
||||
const { readFileSync } = require("fs");
|
||||
const pkg = require("./package.json");
|
||||
const parseEnvVariables = (filepath) => {
|
||||
const envVars = Object.entries(dotenv.parse(readFileSync(filepath))).reduce(
|
||||
(env, [key, value]) => {
|
||||
env[key] = value;
|
||||
return env;
|
||||
},
|
||||
{},
|
||||
);
|
||||
|
||||
envVars.PKG_NAME = pkg.name;
|
||||
envVars.PKG_VERSION = pkg.version;
|
||||
|
||||
return envVars;
|
||||
};
|
||||
|
||||
module.exports = { parseEnvVariables };
|
||||
Reference in New Issue
Block a user