Skip to content

Commit

Permalink
chore: merge branch dev to main (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX authored Sep 9, 2023
2 parents 5d50d1a + 0304988 commit 2b6051e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 3.1.0
version = 3.1.1-dev.1
8 changes: 4 additions & 4 deletions src/main/kotlin/app/revanced/cli/command/OptionsCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal object OptionsCommand : Runnable {
@CommandLine.Option(
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(
names = ["-o", "--overwrite"], description = ["Overwrite existing options file"], showDefaultValue = ALWAYS
Expand All @@ -37,10 +37,10 @@ internal object OptionsCommand : Runnable {
)
private var update: Boolean = false

override fun run() = if (!path.exists() || overwrite) with(PatchBundleLoader.Jar(*patchBundles)) {
if (update) setOptions(path)
override fun run() = if (!filePath.exists() || overwrite) with(PatchBundleLoader.Jar(*patchBundles)) {
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")
}

0 comments on commit 2b6051e

Please sign in to comment.