import { join } from "path";

export function resolveAttachmentsRoot() {
    const explicit = process.env.ATTACHMENTS_ROOT?.trim();
    if (explicit) return explicit; //direct filepath if possible
    
    const id = (process.env.ATTACHMENTS_SERVER_ID ?? 'server').trim();
    return process.platform === 'win32' ? `\\\\${id}\\attachments` : `/mnt/attachments`; //check if server is using windows or linux
}
export const ATT_TMP_DIR = () => join(resolveAttachmentsRoot(), '_tmp'); 