24 lines
835 B
JavaScript
Raw Normal View History

2020-04-25 21:28:13 +01:00
const gfin = require('get-files-in')
const shellExec = require('shell-exec')
module.exports = {
getListOfAPk: () => {
2020-04-26 12:24:50 +01:00
this.apkListToInstall = gfin('./data/apps', matchFiletypes = ["apk"], checkSubDirectories = false)
2020-04-25 21:28:13 +01:00
},
installApk: async () => {
await module.exports.getListOfAPk()
for (let element of this.apkListToInstall) {
2020-04-26 12:24:50 +01:00
if (process.platform === 'win32' || process.platform === 'win64') {
await shellExec('adb install -r ' + element).then(function (result) {
console.log('Installing ' + element + ' - ' + result.stdout);
});
} else {
await shellExec('./adb install -r ' + element).then(function (result) {
console.log('Installing ' + element + ' - ' + result.stdout);
});
}
2020-04-25 21:28:13 +01:00
}
// console.log(chalk.green('Removal Complete'))
},
};