Skip to content

Commit

Permalink
fix: make integrations optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Sculas committed Apr 11, 2022
1 parent 967fac4 commit bea8b82
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/kotlin/app/revanced/cli/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ class Main {
inApk: String,
inSignatures: String,
inPatches: String,
integrations: String,
inIntegrations: String?,
inOutput: String,
) {
val apk = Preconditions.isFile(inApk)
val signatures = Preconditions.isFile(inSignatures)
val patchesFile = Preconditions.isFile(inPatches)
val integrationsFile = Preconditions.isFile(integrations)
val output = Preconditions.isDirectory(inOutput)

val patcher = Patcher(
Expand All @@ -36,7 +35,10 @@ class Main {
.toTypedArray()
)

patcher.addFiles(integrationsFile)
inIntegrations?.let {
val integrations = Preconditions.isFile(it)
patcher.addFiles(integrations)
}

PatchLoader.injectPatches(patchesFile)
val patches = Patches.loadPatches()
Expand Down Expand Up @@ -81,7 +83,7 @@ class Main {
fullName = "integrations",
shortName = "i",
description = "Integrations APK file"
).required()
)
val output by parser.option(
ArgType.String,
fullName = "output",
Expand Down

0 comments on commit bea8b82

Please sign in to comment.