{
    "version": "1.3.13",
    "description": "Incredibly fast JavaScript runtime, bundler, transpiler and package manager - all in one.",
    "homepage": "https://bun.sh/",
    "license": "MIT",
    "suggest": {
        "vcredist": "extras/vcredist2022"
    },
    "architecture": {
        "64bit": {
            "url": [
                "https://github.com/oven-sh/bun/releases/download/bun-v1.3.13/bun-windows-x64.zip",
                "https://github.com/oven-sh/bun/releases/download/bun-v1.3.13/bun-windows-x64-baseline.zip"
            ],
            "hash": [
                "85b14f3e0584218e9b63407b3aa6b90c4835ec5c32435c1f12cb6fc13667c7c9",
                "c68c7903c1190101590cc1b2129835f47211b3b37ae87759f2b97d6534aa3ad1"
            ]
        },
        "arm64": {
            "url": "https://github.com/oven-sh/bun/releases/download/bun-v1.3.13/bun-windows-aarch64.zip",
            "hash": "feaf3f2951c50104dc9a33cf1a2e1ae3422f0c7e5d8890601c87b97b5d90b376"
        }
    },
    "pre_install": [
        "# Migrate legacy Bun data if it exists and the new persist directory doesn't exist",
        "$legacy_bun = Join-Path -Path $env:USERPROFILE -ChildPath '.bun'",
        "if ((Test-Path $legacy_bun) -and -not (Test-Path $persist_dir)) {",
        "    Write-Host \"Migrating legacy Bun data from '$legacy_bun' to '$persist_dir'.\" -ForegroundColor Yellow",
        "    Move-Item $legacy_bun $persist_dir -Force",
        "} elseif ((Test-Path $legacy_bun) -and (Test-Path $persist_dir)) {",
        "    Write-Host \"Found both '$legacy_bun' and '$persist_dir'. Skipping auto-migration; please migrate manually if needed.\" -ForegroundColor Yellow",
        "}",
        "",
        "# Extract the appropriate binary based on architecture and CPU features",
        "if ($architecture -eq 'arm64') {",
        "    $target = 'bun-windows-aarch64'",
        "} else {",
        "    $avx2 = Start-Job -ScriptBlock {",
        "        Add-Type -MemberDefinition '[DllImport(\"kernel32.dll\")] public static extern bool IsProcessorFeaturePresent(int ProcessorFeature);' -Name Kernel32 -Namespace Win32",
        "        return [Win32.Kernel32]::IsProcessorFeaturePresent(40)",
        "    } | Receive-Job -Wait -AutoRemoveJob",
        "    $target = 'bun-windows-x64'",
        "    if (-not $avx2) {",
        "        $target += '-baseline'",
        "    }",
        "}",
        "Move-Item \"$dir\\$target\\bun.exe\" \"$dir\\bun.exe\"",
        "Remove-Item \"$dir\\bun-windows-*\" -Recurse"
    ],
    "installer": {
        "script": "Add-Path -Path \"$persist_dir\\bin\" -Global:$global -Force"
    },
    "env_set": {
        "BUN_INSTALL": "$persist_dir",
        "BUN_INSTALL_BIN": "$persist_dir\\bin",
        "BUN_INSTALL_GLOBAL_DIR": "$persist_dir\\install\\global"
    },
    "bin": [
        "bun.exe",
        [
            "bun.exe",
            "bunx",
            "x"
        ]
    ],
    "persist": [
        "bin",
        "install"
    ],
    "uninstaller": {
        "script": "Remove-Path -Path \"$persist_dir\\bin\" -Global:$global"
    },
    "checkver": {
        "github": "https://github.com/oven-sh/bun",
        "re": "bun-v([\\d.]+)"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": [
                    "https://github.com/oven-sh/bun/releases/download/bun-v$version/bun-windows-x64.zip",
                    "https://github.com/oven-sh/bun/releases/download/bun-v$version/bun-windows-x64-baseline.zip"
                ]
            },
            "arm64": {
                "url": "https://github.com/oven-sh/bun/releases/download/bun-v$version/bun-windows-aarch64.zip"
            }
        },
        "hash": {
            "url": "$baseurl/SHASUMS256.txt"
        }
    }
}
