I can't remember what I worked on just have a look
This commit is contained in:
parent
75b49147df
commit
2a8f65c953
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -9,6 +9,8 @@ gradlew
|
|||
gradlew.bat
|
||||
.kotlin
|
||||
|
||||
test
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
.idea/modules.xml
|
||||
|
|
|
@ -58,7 +58,7 @@ suspend fun main(args: Array<String>) {
|
|||
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<String>) {
|
|||
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<String>) {
|
|||
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")
|
||||
|
|
Loading…
Reference in New Issue
Block a user