{
    "version": "9.4.0",
    "description": "Distributed, RESTful Search Engine",
    "homepage": "https://www.elastic.co/products/elasticsearch",
    "license": {
        "identifier": "Freeware|Apache-2.0",
        "url": "https://github.com/elastic/elasticsearch/blob/master/LICENSE.txt"
    },
    "architecture": {
        "64bit": {
            "url": "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-9.4.0-windows-x86_64.zip",
            "hash": "sha512:a847e0c97bcabe9551b608a915f9f7cdb4284eeb5e2d87b05c782c858118a63f47478c001aa2a20b5b6142df634d39ac4e7bdd4069dd60a9af63b33a0da3c088"
        }
    },
    "extract_dir": "elasticsearch-9.4.0",
    "pre_install": [
        "    # Overwrite SCRIPT because elasticsearch-env.bat doesn't care if SCRIPT or ES_HOME are already set ...",
        "$file = \"$dir\\bin\\elasticsearch-env.bat\"",
        "$cont = (Get-Content \"$file\") -replace 'set SCRIPT=%0', \"set SCRIPT=$file\"",
        "Set-Content \"$file\" ($cont -join \"`r`n\") -Encoding ASCII",
        "    # use persistent data/logs directory",
        "$file = \"$dir\\config\\elasticsearch.yml\"",
        "$cont = (Get-Content \"$file\") -replace '#path.data:.*$', \"path.data: $persist_dir\\data\"",
        "$cont = $cont -replace '#path.logs:.*$', \"path.logs: $persist_dir\\logs\"",
        "Set-Content \"$file\" ($cont -join \"`r`n\") -Encoding ASCII"
    ],
    "env_add_path": "bin",
    "persist": [
        "config",
        "plugins"
    ],
    "checkver": {
        "url": "https://www.elastic.co/downloads/elasticsearch",
        "regex": "elasticsearch-([\\d.]+)-windows"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$version-windows-x86_64.zip"
            }
        },
        "hash": {
            "url": "$url.sha512"
        },
        "extract_dir": "elasticsearch-$version"
    }
}
