From f052ef1cb95240223928c27e38f106644133e8e1 Mon Sep 17 00:00:00 2001 From: Helight Date: Mon, 13 Sep 2021 11:27:27 +0200 Subject: [PATCH] Fix linux init & run --- cli/bin/barrel.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cli/bin/barrel.dart b/cli/bin/barrel.dart index 7e7f7ad..ee7cf7c 100644 --- a/cli/bin/barrel.dart +++ b/cli/bin/barrel.dart @@ -16,7 +16,7 @@ var dio = Dio(); var uuids = Uuid(); var spigotVersions = ["1.17.1", "1.16.5", "1.12.2", "1.8.8"]; //Common versions -var javaVersions = ["16", "15", "8", "8"]; +var javaVersions = ["16", "16", "16", "16"]; var helpMessage = """ @@ -66,7 +66,8 @@ Future run(bool dockerized) async { if (Platform.isWindows) { await runWrappedCmd("start.bat", []); } else if (Platform.isLinux) { - await runWrappedCmd("start.sh", []); + await runCmd("chmod", ["700", "./start.sh"]); + await runWrappedCmd("./start.sh", []); } } else { var buildId = uuids.v4().replaceAll("-", ""); @@ -162,7 +163,8 @@ Future init() async { if (Platform.isWindows) { await runWrappedCmd("start.bat", []); } else if (Platform.isLinux) { - await runWrappedCmd("start.sh", []); + await runCmd("chmod", ["700", "./start.sh"]); + await runWrappedCmd("./start.sh", []); } await tempSocket?.close(); @@ -289,6 +291,6 @@ Future runWrappedCmd(String cmd, List args) async { Future getLatestPaperBuild(String version) async { var response = await dio .get("https://papermc.io/api/v2/projects/paper/versions/$version"); - var latestBuild = (response.data["builds"] as List).first as int; + var latestBuild = (response.data["builds"] as List).last as int; return latestBuild; }