diff --git a/.gitignore b/.gitignore index 2af845b..913c7ea 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ gradlew gradlew.bat .kotlin +test + ### IntelliJ IDEA ### .idea .idea/modules.xml diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt index 34b4b03..21f4c18 100644 --- a/src/main/kotlin/Main.kt +++ b/src/main/kotlin/Main.kt @@ -58,7 +58,7 @@ suspend fun main(args: Array) { println(userInput) if (userInput == "g") { val userInput: String = args[1] - val linkToUse = "https://git.maxwellj.xyz/mapm/stable/raw/branch/main/$userInput" + val linkToUse = "https://git.maxwellj.xyz/mapm/stable/raw/branch/main/$userInput/source" val dingus = Fuel.get(linkToUse).body.string() println("Package $userInput found at $dingus") // val packageList = listOf($userInput) @@ -72,7 +72,7 @@ suspend fun main(args: Array) { val file = File("/usr/mapm/tmp/$userInput.tar.xz") val fileBytes = Fuel.get(dingus).body.bytes() file.writeBytes(fileBytes) - val fileChecksum = Fuel.get("https://git.maxwellj.xyz/mapm/stable/raw/branch/main/$userInput.hash").body.string() + val fileChecksum = Fuel.get("https://git.maxwellj.xyz/mapm/stable/raw/branch/main/$userInput/hash").body.string() if (fileChecksum == md5(file.readText())) { println("Checksum matches!") uncompressXZFile(inputFile = "/usr/mapm/tmp/${userInput}.tar.xz", outputFile = "/usr/mapm/tmp/${userInput}.tar") @@ -97,6 +97,8 @@ suspend fun main(args: Array) { val userInput = args[1] val file = File(userInput) println("Checksum of that file is ${md5(file.readText())}") + } else if (userInput == "m") { + println("this feature is in progress") } else { println("mapm - Max's Package Manager") println("Version 0.0.2")