Compare commits
3 Commits
4271b28acd
...
0.0.2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2a8f65c953 | ||
![]() |
75b49147df | ||
![]() |
ea5bb86f7e |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -9,6 +9,8 @@ gradlew
|
|||||||
gradlew.bat
|
gradlew.bat
|
||||||
.kotlin
|
.kotlin
|
||||||
|
|
||||||
|
test
|
||||||
|
|
||||||
### IntelliJ IDEA ###
|
### IntelliJ IDEA ###
|
||||||
.idea
|
.idea
|
||||||
.idea/modules.xml
|
.idea/modules.xml
|
||||||
|
@@ -10,7 +10,7 @@ application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "xyz.maxwellj.mapm"
|
group = "xyz.maxwellj.mapm"
|
||||||
version = "0.0.1"
|
version = "0.0.2"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
@@ -58,7 +58,7 @@ suspend fun main(args: Array<String>) {
|
|||||||
println(userInput)
|
println(userInput)
|
||||||
if (userInput == "g") {
|
if (userInput == "g") {
|
||||||
val userInput: String = args[1]
|
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()
|
val dingus = Fuel.get(linkToUse).body.string()
|
||||||
println("Package $userInput found at $dingus")
|
println("Package $userInput found at $dingus")
|
||||||
// val packageList = listOf($userInput)
|
// val packageList = listOf($userInput)
|
||||||
@@ -72,7 +72,7 @@ suspend fun main(args: Array<String>) {
|
|||||||
val file = File("/usr/mapm/tmp/$userInput.tar.xz")
|
val file = File("/usr/mapm/tmp/$userInput.tar.xz")
|
||||||
val fileBytes = Fuel.get(dingus).body.bytes()
|
val fileBytes = Fuel.get(dingus).body.bytes()
|
||||||
file.writeBytes(fileBytes)
|
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())) {
|
if (fileChecksum == md5(file.readText())) {
|
||||||
println("Checksum matches!")
|
println("Checksum matches!")
|
||||||
uncompressXZFile(inputFile = "/usr/mapm/tmp/${userInput}.tar.xz", outputFile = "/usr/mapm/tmp/${userInput}.tar")
|
uncompressXZFile(inputFile = "/usr/mapm/tmp/${userInput}.tar.xz", outputFile = "/usr/mapm/tmp/${userInput}.tar")
|
||||||
@@ -97,5 +97,21 @@ suspend fun main(args: Array<String>) {
|
|||||||
val userInput = args[1]
|
val userInput = args[1]
|
||||||
val file = File(userInput)
|
val file = File(userInput)
|
||||||
println("Checksum of that file is ${md5(file.readText())}")
|
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")
|
||||||
|
println("(C) Maxwell Jeffress 2024, licensed under the GNU GPL V3")
|
||||||
|
println("")
|
||||||
|
println("---Help---")
|
||||||
|
println("Arguments that can be run")
|
||||||
|
println("g Grab a package from the internet")
|
||||||
|
println("r Remove a package")
|
||||||
|
println("c Generate a checksum for a package")
|
||||||
|
println("")
|
||||||
|
println("More info at the following links:")
|
||||||
|
println("https://maxwellj.xyz/mapm")
|
||||||
|
println("https://git.maxwellj.xyz/max/mapm")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user