24 lines
827 B
Kotlin
24 lines
827 B
Kotlin
![]() |
package xyz.maxwellj.mapm
|
||
|
|
||
|
import fuel.Fuel
|
||
|
import fuel.get
|
||
|
import java.io.File
|
||
|
|
||
|
suspend fun main() {
|
||
|
println("Welcome to Mapm! What would you like to do? Type help for some help.")
|
||
|
val userInput = readln()
|
||
|
if (userInput == "grab") {
|
||
|
println("What would you like to grab?")
|
||
|
val userInput = readln()
|
||
|
val linkToUse = "https://git.maxwellj.xyz/mapm/stable/raw/branch/main/" + userInput
|
||
|
val dingus = Fuel.get(linkToUse).body.string()
|
||
|
println(dingus)
|
||
|
val file = File("/usr/mapm/$userInput")
|
||
|
file.writeText(Fuel.get(dingus).body.string())
|
||
|
Runtime.getRuntime().exec("chmod +x /usr/mapm/$userInput")
|
||
|
println("Finished!")
|
||
|
} else if (userInput == "delete") {
|
||
|
println("What would you like to delete?")
|
||
|
val userInput = readln()
|
||
|
}
|
||
|
}
|