summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-10-08 02:32:01 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-10-08 02:32:01 +0200
commitd293b34578bcf856885ed30774d88e42f406aed5 (patch)
treeacd134fddf437bc3c701ffee73c13066af6300a4
parent9759550fc56960b928e2a2dd230ce5fff22738b1 (diff)
downloadminecraft-isekai-d293b34578bcf856885ed30774d88e42f406aed5.tar.gz
version
-rwxr-xr-xbuilder.sh27
1 files changed, 24 insertions, 3 deletions
diff --git a/builder.sh b/builder.sh
index 80b7b3d..9fee1d6 100755
--- a/builder.sh
+++ b/builder.sh
@@ -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."