working flow for install/uninstall

This commit is contained in:
karl.hudgell 2020-04-25 14:21:45 +01:00
parent 96536414c0
commit 3c31e4838c

View File

@ -7,22 +7,27 @@ const files = require('../lib/files')
module.exports = { module.exports = {
removeApps: async () => { removeApps: async () => {
common.header('Remove Apps') common.header('Remove Apps')
const value = await inquirer.removeAppsList(); const value = await inquirer.removeAppsList();
value.removeAppsList.forEach(async (element) => { for (let element of value.removeAppsList) {
await shellExec('adb shell pm uninstall -k --user 0 ' + element).then(async function (result) { await shellExec('adb shell pm uninstall -k --user 0 ' + element).then(function (result) {
console.log('Removing ' + element + ' - ' + result.stdout) console.log('Removing ' + element + ' - ' + result.stdout);
}).catch() });
}); }
console.log('complete') console.log(chalk.green('Removal Complete'))
await common.pause(2000)
module.exports.mainMenu()
}, },
restoreApps: async () => { restoreApps: async () => {
common.header('Restore Apps') common.header('Remove Apps')
const value = await inquirer.removeAppsList(); const value = await inquirer.removeAppsList();
value.removeAppsList.forEach(element => { for (let element of value.removeAppsList) {
shellExec('adb shell cmd package install-existing ' + element).then(async function (result) { await shellExec('adb shell cmd package install-existing ' + element).then(function (result) {
console.log('Installing ' + element + ' - ' + result.stdout) console.log('Removing ' + element + ' - ' + result.stdout);
}).catch() });
}); }
console.log(chalk.green('Restore Complete'))
await common.pause(2000)
module.exports.mainMenu()
}, },
connectWifi: async () => { connectWifi: async () => {
common.header('Connect Wifi') common.header('Connect Wifi')