mapm/src/main/kotlin/Main.kt

24 lines
827 B
Kotlin
Raw Normal View History

2024-08-28 13:29:10 +10:00
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()
}
}