import fs, { readFileSync } from "fs";
import path from "path";
import process from "process";

let configJson;
// if (process.env.IS_ELECTRON) {
const dirName = process.env.PORTABLE_EXECUTABLE_DIR;
if (dirName) {
  configJson = readFileSync(path.join(dirName || "", "config.json"));
} else {
  configJson = readFileSync(path.join(__dirname, "../config.json"));
}

const store = JSON.parse(configJson.toString());

export default store;
