Only show App Bundle warning after patching single APK

This commit is contained in:
Niklas Higi
2019-11-04 19:33:24 +01:00
parent 0057054d27
commit 70e07bffce
2 changed files with 6 additions and 6 deletions
+4 -2
View File
@@ -4,7 +4,7 @@ import chalk from 'chalk'
import Listr from 'listr'
import tempy from 'tempy'
import patchApk from './patch-apk'
import patchApk, { showAppBundleWarning } from './patch-apk'
import { patchXapkBundle, patchApksBundle } from './patch-app-bundle'
import Apktool from './tools/apktool'
@@ -64,7 +64,9 @@ async function main() {
console.log(chalk.dim(` Using temporary directory:\n ${tmpDir}\n`))
taskFunction({ inputPath, outputPath, tmpDir, apktool }).run().then(context => {
if (context.onFinished) context.onFinished()
if (taskFunction === patchApk && context.usesAppBundle) {
showAppBundleWarning()
}
console.log(
chalk`\n {green.inverse Done! } Patched file: {bold ./${outputName}}\n`,
+2 -4
View File
@@ -30,9 +30,7 @@ export default function patchApk({ inputPath, outputPath, tmpDir, apktool }: Tas
)
nscName = result.nscName
if (result.usesAppBundle) {
context.onFinished = showAppBundleWarning
}
context.usesAppBundle = result.usesAppBundle
},
},
{
@@ -87,7 +85,7 @@ export default function patchApk({ inputPath, outputPath, tmpDir, apktool }: Tas
])
}
function showAppBundleWarning() {
export function showAppBundleWarning() {
console.log(chalk`{yellow
{inverse.bold WARNING }