more clenaup

This commit is contained in:
karl.hudgell 2020-08-27 17:10:47 +01:00
parent 4893d4c124
commit 42138024a9
2 changed files with 6 additions and 3 deletions

View File

@ -4,10 +4,10 @@ const figlet = require('figlet');
const fs = require('fs') const fs = require('fs')
var pjson = require('../package.json'); var pjson = require('../package.json');
const fetch = require('node-fetch'); const fetch = require('node-fetch');
var shell = require('shelljs');
const globalVariables = require('../lib/globalVars'); const globalVariables = require('../lib/globalVars');
module.exports = { module.exports = {
header: (page) => { header: (page) => {
clear(); clear();
@ -63,4 +63,7 @@ module.exports = {
.then(res => res.json()) .then(res => res.json())
return response return response
}, },
clearApkFolder: async () => {
await shell.rm('-rf', './data/apps/*.apk');
},
} }

View File

@ -75,7 +75,7 @@ module.exports = {
const compatibleApps = await common.getCompatibleAppsList() const compatibleApps = await common.getCompatibleAppsList()
const value = await inquirer.compatibleApps(); const value = await inquirer.compatibleApps();
await shell.rm('-rf', './data/apps/*.apk'); await common.clearApkFolder()
for (let element of value.removeAppsList) { for (let element of value.removeAppsList) {
for (let element2 of compatibleApps) { for (let element2 of compatibleApps) {
@ -247,7 +247,7 @@ module.exports = {
logger.info("Remove Complete") logger.info("Remove Complete")
logger.info("Compatible Apps") logger.info("Compatible Apps")
await shell.rm('-rf', './data/apps/*.apk'); await common.clearApkFolder()
const compatibleApps = await common.getCompatibleAppsList() const compatibleApps = await common.getCompatibleAppsList()