@dotenc/cli
Version:
🔐 Secure, encrypted environment variables that live in your codebase
14 lines (13 loc) • 563 B
JavaScript
import { existsSync, readFileSync, writeFileSync } from "node:fs";
import os from "node:os";
import path from "node:path";
import { getProjectConfig } from "../../helpers/projectConfig.js";
export const cleanupProjectKeys = async () => {
const { projectId } = await getProjectConfig();
const keysFile = path.join(os.homedir(), ".dotenc", "keys.json");
if (existsSync(keysFile)) {
const keys = JSON.parse(readFileSync(keysFile, "utf-8"));
delete keys[projectId];
writeFileSync(keysFile, JSON.stringify(keys, null, 2));
}
};