"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.openUrlInBrowser = openUrlInBrowser;
const command_1 = require("./command");
async function openUrlInBrowser(url) {
    const command = resolveBrowserOpenCommand(url);
    await (0, command_1.runCommand)({
        command: command.command,
        args: command.args,
    });
}
function resolveBrowserOpenCommand(url) {
    if (process.platform === "darwin") {
        return { command: "open", args: [url] };
    }
    if (process.platform === "win32") {
        return {
            command: "rundll32.exe",
            args: ["url.dll,FileProtocolHandler", url],
        };
    }
    return { command: "xdg-open", args: [url] };
}
