Skip to content

Commit

Permalink
Fix ordering
Browse files Browse the repository at this point in the history
Remove Incorrect search/check
  • Loading branch information
Moocow9m committed Sep 25, 2019
1 parent 4bfce13 commit 2c06c94
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/main/kotlin/com/wavProductions/www/armitage/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,15 @@ import java.nio.file.Files
import java.nio.file.Paths

fun main() {
loadConfig()
val resources = Paths.get("resources").toAbsolutePath()
var location = ""
if (Config.javaClass.getResource("icon.png") == null) {
location = Paths.get("src", "main", "resources").toAbsolutePath().toString()
}
if (Files.notExists(resources)) {
Files.createDirectories(resources)
}
loadConfig()
val iconPath = Paths.get(resources.toString(), "icon.png")
if (Files.notExists(iconPath)) {
var stream: InputStream? = Config.javaClass.getResourceAsStream("icon.png")
if (stream == null) {
stream = Files.newInputStream(Paths.get(location, "icon.png"))
}
if (stream == null) {
throw RuntimeException("Corrupted jar resources!")
}
val stream: InputStream = Config.javaClass.getResourceAsStream("/icon.png")
?: throw RuntimeException("Corrupted jar resources!")
Files.write(iconPath, stream.readAllBytes())
stream.close()
}
Expand All @@ -37,9 +28,10 @@ fun main() {
window.setIconSync(icon.convertToIcon())
window.showSync()
Viken.loop()
while (!conn.consoleActive()) {
while (conn.consoleActive()) {
Thread.onSpinWait()
}
Thread.sleep(20000) //run for 20 seconds for testing
Viken.cleanup()
icon.dispose()
}

0 comments on commit 2c06c94

Please sign in to comment.