{
    "version": "5857-g3681e397f",
    "description": "A single binary that contains many common Unix tools.",
    "homepage": "https://frippery.org/busybox",
    "license": "GPL-2.0-only",
    "architecture": {
        "64bit": {
            "url": "https://frippery.org/files/busybox/busybox-w64-FRP-5857-g3681e397f.exe#/busybox.exe",
            "hash": "0ee2bfac98adea79969ff9a969799def74db332a86afa87a890e6230642eb901"
        },
        "32bit": {
            "url": "https://frippery.org/files/busybox/busybox-w32-FRP-5857-g3681e397f.exe#/busybox.exe",
            "hash": "94baf9f3db6edccff5dd378c14e6f61b9cbdd253479ed07671e498cf0f72ef28"
        },
        "arm64": {
            "url": "https://frippery.org/files/busybox/busybox-w64a-FRP-5857-g3681e397f.exe#/busybox.exe",
            "hash": "4e39dc577782fd0af75222738e609ba43d8d2a98131e88928f1b0dad45048b99"
        }
    },
    "pre_install": [
        "if (-not (Test-Path -Path \"$env:USERPROFILE\\.profile\" -PathType Leaf)) {",
        "    Write-Host \"`nINFO  Creating '~/.profile'...\" -ForegroundColor DarkGray",
        "    $cfg = @('if [ -f ~/.bashrc ]; then', '    source ~/.bashrc', 'fi')",
        "    Set-Content -Path \"$env:USERPROFILE\\.profile\" -Value $cfg -Encoding oem",
        "}"
    ],
    "post_install": [
        "$process_info = [System.Diagnostics.ProcessStartInfo]@{",
        "    FileName = \"$dir\\busybox.exe\"; Arguments = '--list'",
        "    CreateNoWindow = $true; UseShellExecute = $false; RedirectStandardOutput = $true",
        "}",
        "$process = [System.Diagnostics.Process]::Start($process_info)",
        "$stdout_content = $process.StandardOutput.ReadToEnd()",
        "$process.WaitForExit()",
        "Write-Output \"`nCreating shim for 'busybox'.\"",
        "shim \"$dir\\busybox.exe\" $global 'busybox'",
        "$stdout_content -split \"`r?`n\" | Where-Object { $_ -match '^\\S' } | ForEach-Object {",
        "    Write-Output \"Creating shim for '$($_.Trim())'.\"",
        "    shim \"$dir\\busybox.exe\" $global $_.Trim() $_.Trim()",
        "}"
    ],
    "uninstaller": {
        "script": [
            "$process_info = [System.Diagnostics.ProcessStartInfo]@{",
            "    FileName = \"$dir\\busybox.exe\"; Arguments = '--list'",
            "    CreateNoWindow = $true; UseShellExecute = $false; RedirectStandardOutput = $true",
            "}",
            "$process = [System.Diagnostics.Process]::Start($process_info)",
            "$stdout_content = $process.StandardOutput.ReadToEnd()",
            "$process.WaitForExit()",
            "rm_shim 'busybox' $(shimdir $global) $app",
            "$stdout_content -split \"`r?`n\" | Where-Object { $_ -match '^\\S' } | ForEach-Object {",
            "    rm_shim $_.Trim() $(shimdir $global) $app",
            "}"
        ]
    },
    "checkver": {
        "url": "https://frippery.org/files/busybox/?C=M;O=D",
        "regex": "busybox-w64-FRP-([\\w-]+)"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://frippery.org/files/busybox/busybox-w64-FRP-$version.exe#/busybox.exe"
            },
            "32bit": {
                "url": "https://frippery.org/files/busybox/busybox-w32-FRP-$version.exe#/busybox.exe"
            },
            "arm64": {
                "url": "https://frippery.org/files/busybox/busybox-w64a-FRP-$version.exe#/busybox.exe"
            }
        },
        "hash": {
            "url": "$baseurl/SHA256SUM"
        }
    }
}
