Skip to content

Commit e3c5550

Browse files
committed
perf: Do not check, if the options file exists twice
1 parent 64afc95 commit e3c5550

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/kotlin/app/revanced/cli/command/OptionsCommand.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ internal object OptionsCommand : Runnable {
3939

4040
override fun run() = try {
4141
PatchBundleLoader.Jar(*patchBundles).let { patches ->
42-
if (!filePath.exists() || overwrite) {
43-
if (update && filePath.exists()) patches.setOptions(filePath)
42+
val exists = filePath.exists()
43+
if (!exists || overwrite) {
44+
if (exists && update) patches.setOptions(filePath)
4445

4546
Options.serialize(patches, prettyPrint = true).let(filePath::writeText)
4647
} else throw OptionsFileAlreadyExistsException()

0 commit comments

Comments
 (0)