mirror of
https://github.com/revanced/revanced-cli.git
synced 2025-02-24 16:21:10 +01:00
perf: Do not check, if the options file exists twice
This commit is contained in:
parent
64afc95a81
commit
e3c55507cf
@ -39,8 +39,9 @@ internal object OptionsCommand : Runnable {
|
|||||||
|
|
||||||
override fun run() = try {
|
override fun run() = try {
|
||||||
PatchBundleLoader.Jar(*patchBundles).let { patches ->
|
PatchBundleLoader.Jar(*patchBundles).let { patches ->
|
||||||
if (!filePath.exists() || overwrite) {
|
val exists = filePath.exists()
|
||||||
if (update && filePath.exists()) patches.setOptions(filePath)
|
if (!exists || overwrite) {
|
||||||
|
if (exists && update) patches.setOptions(filePath)
|
||||||
|
|
||||||
Options.serialize(patches, prettyPrint = true).let(filePath::writeText)
|
Options.serialize(patches, prettyPrint = true).let(filePath::writeText)
|
||||||
} else throw OptionsFileAlreadyExistsException()
|
} else throw OptionsFileAlreadyExistsException()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user