let version = (fetch_version --version-id 1.19 --version-type release)
fetch_jar $version --download-type client
Created
June 23, 2022 23:10
-
-
Save theoparis/3007855e74b11fa8172d0ba876f26e5d to your computer and use it in GitHub Desktop.
Get minecraft jar via nushell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/nu | |
def fetch_version [ | |
--version-id: string | |
--version-type: string | |
] { | |
mkdir work | |
let version_manifest = (fetch https://launchermeta.mojang.com/mc/game/version_manifest.json) | |
let version = ($version_manifest.versions | where id == $version-id | where type == $version-type | first 1) | |
fetch $version.url | |
} | |
def fetch_jar [ | |
--download-type: string | |
version_data | |
] { | |
let jar_url = ($version_data.downloads | get $download-type | get url) | |
fetch $jar_url | save ($download-type + ".jar") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment