Skip to content
Permalink
Browse files

Check if user has deployed at least an app.

  • Loading branch information
charlietango committed Nov 28, 2019
1 parent d43aba9 commit 05ab3b586dc77c20bbcd7e51c5d544e9aa9942f7
Showing with 10 additions and 5 deletions.
  1. +10 −5 utils/commands.js
@@ -207,11 +207,16 @@ const updateFramework = async () => {
const backup = async () => {
await registerUser();
let appsList = await getAppsList();
const question = questions.APP_BACKUP;
question.choices = appsList.map((app) => ({ name: app.name, value: app.id }));
const backupAnswer = await inquirer.prompt([question]);
await backupApp(backupAnswer.appId);
process.exit();
if (appsList.length === 0) {
log(chalk.yellow('No apps deployed yet.'));
process.exit();
} else {
const question = questions.APP_BACKUP;
question.choices = appsList.map((app) => ({ name: app.name, value: app.id }));
const backupAnswer = await inquirer.prompt([question]);
await backupApp(backupAnswer.appId);
process.exit();
}
}

module.exports = { create, deploy, clean, build, updateFramework, backup }

0 comments on commit 05ab3b5

Please sign in to comment.
You can’t perform that action at this time.