Skip to content
This repository has been archived by the owner on Dec 4, 2022. It is now read-only.

Commit

Permalink
Some patches to support migration
Browse files Browse the repository at this point in the history
- RepoData.kt  : RepoExtension assumes type to default as LuaScript
- RepoIndex.kt : expose json object
  • Loading branch information
Doomsdayrs committed Jun 11, 2021
1 parent 3944086 commit 5b0759d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/app/shosetsu/lib/json/RepoData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ data class RepoExtension internal constructor(
@SerialName(J_MD5)
val md5: String,
@SerialName(J_EXTENSION_TYPE)
val type: ExtensionType
val type: ExtensionType = ExtensionType.LuaScript
)


Expand Down
3 changes: 1 addition & 2 deletions src/main/kotlin/app/shosetsu/lib/json/RepoIndex.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import java.io.File

/**
* shosetsu-kotlin-lib
Expand All @@ -24,6 +23,6 @@ data class RepoIndex internal constructor(
const val LIBS_KEY = "libraries"
const val SCPS_KEY = "scripts"

fun fromString(json: String): RepoIndex = Json.decodeFromString(json)
fun fromString(content: String, json: Json = Json {}): RepoIndex = json.decodeFromString(content)
}
}

0 comments on commit 5b0759d

Please sign in to comment.