import os from "node:os";
import path from "node:path";
export function patchtrailAppDataDir(env = process.env) {
    if (env.PATCHTRAIL_APP_DATA_DIR)
        return env.PATCHTRAIL_APP_DATA_DIR;
    if (process.platform === "darwin") {
        return path.join(os.homedir(), "Library", "Application Support", "PatchTrail");
    }
    if (process.platform === "win32") {
        return path.join(env.APPDATA ?? path.join(os.homedir(), "AppData", "Roaming"), "PatchTrail");
    }
    return path.join(env.XDG_CONFIG_HOME ?? path.join(os.homedir(), ".config"), "patchtrail");
}
