import { cp, mkdir, rm, symlink } from 'node:fs/promises';
import { relative } from 'node:path';
export async function syncInstalledPayloadPointer(params) {
    await rm(params.pointerPath, { recursive: true, force: true });
    if (process.platform === 'win32') {
        await mkdir(params.pointerPath, { recursive: true });
        await cp(params.versionPath, params.pointerPath, { recursive: true });
        return;
    }
    const relativeTarget = relative(params.layout.installRoot, params.versionPath);
    await symlink(relativeTarget, params.pointerPath, 'dir');
}
//# sourceMappingURL=syncInstalledPayloadPointer.js.map