switch for unix

This commit is contained in:
karl.hudgell 2020-04-28 13:02:35 +01:00
parent 100ac8f013
commit 6c7a89689e

View File

@ -18,7 +18,11 @@ module.exports = {
let installedAppList let installedAppList
common.header('Remove Installed Apps') common.header('Remove Installed Apps')
await shellExec(adbRun + ' shell pm list packages -3').then(async function (result) { await shellExec(adbRun + ' shell pm list packages -3').then(async function (result) {
if (process.platform === 'win32' || process.platform === 'win64') {
installedAppList = result.stdout.split('\r\n'); // split string on comma space installedAppList = result.stdout.split('\r\n'); // split string on comma space
} else {
installedAppList = result.stdout.split('\n'); // split string on comma space
}
installedAppList.splice(-1, 1) installedAppList.splice(-1, 1)
}); });
const value = await inquirer.installedApps(installedAppList); const value = await inquirer.installedApps(installedAppList);