-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
005c15e
commit 4b891f1
Showing
12 changed files
with
63 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
package teksturepako.pakku | ||
|
||
const val VERSION = "0.12.1" | ||
const val VERSION = "0.13.1" |
2 changes: 1 addition & 1 deletion
2
src/commonMain/kotlin/teksturepako/pakku/api/actions/export/RuleContext.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/commonMain/kotlin/teksturepako/pakku/api/models/mr/MrModpackModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
package teksturepako.pakku.io | ||
|
||
import korlibs.io.file.std.localCurrentDirVfs | ||
import kotlinx.serialization.StringFormat | ||
import kotlinx.serialization.encodeToString | ||
import teksturepako.pakku.api.data.json | ||
import kotlin.io.path.* | ||
|
||
suspend inline fun <reified T> writeToFile( | ||
inline fun <reified T> writeToFile( | ||
value: T, | ||
path: String, | ||
overrideText: Boolean = false, | ||
format: StringFormat = json | ||
) | ||
{ | ||
val file = localCurrentDirVfs[path] | ||
) = runCatching { | ||
val file = Path(path) | ||
|
||
// Override file text | ||
if (overrideText && file.exists()) file.delete() | ||
if (overrideText && file.exists()) file.deleteIfExists() | ||
|
||
// Write to file | ||
file.parent.mkdirs() | ||
file.writeString(format.encodeToString(value)) | ||
file.parent.createParentDirectories() | ||
file.writeText(format.encodeToString(value)) | ||
} |