From 0ab461ca6484dc8314dbdc8662b182278e8e347b Mon Sep 17 00:00:00 2001 From: Andrea Adamczyk Date: Thu, 28 Feb 2019 13:54:36 -0400 Subject: [PATCH] PMC-536 --- workflow/engine/bin/tasks/cliPlugins.php | 26 ++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/workflow/engine/bin/tasks/cliPlugins.php b/workflow/engine/bin/tasks/cliPlugins.php index 22faa6692..e0950545c 100644 --- a/workflow/engine/bin/tasks/cliPlugins.php +++ b/workflow/engine/bin/tasks/cliPlugins.php @@ -53,20 +53,30 @@ CLI::taskRun("run_create"); function run_create($command, $args) { - CLI::logging("Create .po file ...\n"); - $language = new Language(); - $language->createLanguagePlugin($command[0], $command[1]); - CLI::logging("Create successful\n"); + if (!empty($command) && count($command) == 2) { + CLI::logging("Create .po file ...\n"); + + $language = new Language(); + $language->createLanguagePlugin($command[0], $command[1]); + CLI::logging("Create successful\n"); + } else { + CLI::logging("The command requires that the plugin name and the language be sent\n"); + } } function run_update($command, $args) { - CLI::logging("Updating...\n"); - $language = new Language(); - $language->updateLanguagePlugin($command[0], $command[1]); - CLI::logging("Update successful\n"); + if (!empty($command) && count($command) == 2) { + CLI::logging("Updating...\n"); + + $language = new Language(); + $language->updateLanguagePlugin($command[0], $command[1]); + CLI::logging("Update successful\n"); + } else { + CLI::logging("The command requires that the plugin name and the language be sent\n"); + } }