chore: merge branch dev to main (#259)

This commit is contained in:
oSumAtrIX 2023-09-09 17:25:04 +02:00 committed by GitHub
commit 2b6051e7f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,10 @@
## [3.1.1-dev.1](https://github.com/ReVanced/revanced-cli/compare/v3.1.0...v3.1.1-dev.1) (2023-09-03)
### Bug Fixes
* Create options if it does not exist when updating them ([ca809f0](https://github.com/ReVanced/revanced-cli/commit/ca809f0948379e3a825f24d7a49aba8b6b8767d1))
# [3.1.0](https://github.com/ReVanced/revanced-cli/compare/v3.0.1...v3.1.0) (2023-08-31) # [3.1.0](https://github.com/ReVanced/revanced-cli/compare/v3.0.1...v3.1.0) (2023-08-31)

View File

@ -1,4 +1,4 @@
org.gradle.parallel = true org.gradle.parallel = true
org.gradle.caching = true org.gradle.caching = true
kotlin.code.style = official kotlin.code.style = official
version = 3.1.0 version = 3.1.1-dev.1

View File

@ -23,7 +23,7 @@ internal object OptionsCommand : Runnable {
@CommandLine.Option( @CommandLine.Option(
names = ["-p", "--path"], description = ["Path to patch options JSON file"], showDefaultValue = ALWAYS names = ["-p", "--path"], description = ["Path to patch options JSON file"], showDefaultValue = ALWAYS
) )
private var path: File = File("options.json") private var filePath: File = File("options.json")
@CommandLine.Option( @CommandLine.Option(
names = ["-o", "--overwrite"], description = ["Overwrite existing options file"], showDefaultValue = ALWAYS names = ["-o", "--overwrite"], description = ["Overwrite existing options file"], showDefaultValue = ALWAYS
@ -37,10 +37,10 @@ internal object OptionsCommand : Runnable {
) )
private var update: Boolean = false private var update: Boolean = false
override fun run() = if (!path.exists() || overwrite) with(PatchBundleLoader.Jar(*patchBundles)) { override fun run() = if (!filePath.exists() || overwrite) with(PatchBundleLoader.Jar(*patchBundles)) {
if (update) setOptions(path) if (update && filePath.exists()) setOptions(filePath)
Options.serialize(this, prettyPrint = true).let(path::writeText) Options.serialize(this, prettyPrint = true).let(filePath::writeText)
} }
else logger.severe("Options file already exists, use --override to override it") else logger.severe("Options file already exists, use --override to override it")
} }