diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2020-10-08 02:32:01 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2020-10-08 02:32:01 +0200 |
commit | d293b34578bcf856885ed30774d88e42f406aed5 (patch) | |
tree | acd134fddf437bc3c701ffee73c13066af6300a4 | |
parent | 9759550fc56960b928e2a2dd230ce5fff22738b1 (diff) | |
download | minecraft-isekai-d293b34578bcf856885ed30774d88e42f406aed5.tar.gz |
version
-rwxr-xr-x | builder.sh | 27 |
1 files changed, 24 insertions, 3 deletions
@@ -169,7 +169,19 @@ function instance_start() { ## version function version() { - fail "not implemented" + local CMD="$1" + case $CMD in + list) ;& + install) ;& + uninstall) + shift + eval 'version_$CMD "$@"' + ;; + *) + fail "version: Unknown argument $CMD" + esac + + exit $? } function version_exists() { @@ -177,10 +189,19 @@ function version_exists() { return $? } +function version_list() { + for VERSION in $VERSIONS/*.jar; do + VERSION="$(basename "$VERSION")" + + echo "${VERSION%%.jar}" + done + return 0 +} + # 1: version 2: instance function version_install() { - local INSTANCE="$1" - local VERSION="$2" + local VERSION="$1" + local INSTANCE="$2" instance_exists "$INSTANCE" || fail "instance $1 not found." version_exists "$VERSION" || fail "version $2 not found." |