diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index f66cd7b..60a6f58 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -1,4 +1,4 @@ -name: CLI Build +name: CLI Release Build on: push: diff --git a/.github/workflows/laravel-zero-build.yml b/.github/workflows/laravel-zero-build.yml index f34d9a7..4bb68df 100644 --- a/.github/workflows/laravel-zero-build.yml +++ b/.github/workflows/laravel-zero-build.yml @@ -3,9 +3,9 @@ name: CLI Beta Build on: push: branches: [ beta ] - + permissions: write-all - + jobs: build: runs-on: ubuntu-latest diff --git a/app/Commands/CloseInterviewCommand.php b/app/Commands/CloseInterviewCommand.php index 08d38e9..4edb345 100644 --- a/app/Commands/CloseInterviewCommand.php +++ b/app/Commands/CloseInterviewCommand.php @@ -21,7 +21,7 @@ class CloseInterviewCommand extends Command * * @var string */ - protected $signature = 'close {name : The candidate name (required)}'; + protected $signature = 'close {name? : The candidate name (required)}'; /** * The description of the command. @@ -59,6 +59,11 @@ public function handle() // Run the app $this->line($this->getApplication()->getName()); + + if(!$this->argument('name') || empty($this->argument('name'))){ + $candidateName = $this->ask('Please enter the candidate name'); + } + $this->candidateName = str_replace(' ', '_', $this->argument('name')); if ($this->task('Running pre-checks...', function () { @@ -98,13 +103,17 @@ public function handle() $this->backupCandidateFiles = $this->confirm('Do you want to backup the candidate files and database?', true); $this->removeCandidateData = $this->confirm('Do you want to delete the candidate files and database?', true); - $this->completionSteps = $this->question('How many steps the candidate completed before the end of the test?', 0); + $this->completionSteps = $this->menu('How many steps the candidate completed before the end of the test?', [ + '1 step', + '2 steps', + '3 steps', + '4 steps', + '5 steps', + ])->disableDefaultItems()->open(); - $this->hireRecommendation = $this->choice('What\'s your recommendation for this candidate?', ['strong no hire', 'not recommended', 'recommended', 'strong hire']); + $this->hireRecomendation = $this->menu('What\'s your recommendation for this candidate?', ['strong no hire', 'not recommended', 'recommended', 'strong hire'], 'strong hire')->disableDefaultItems()->open(); - if($this->hireRecommendation > 1){ - $this->indicatedPosition = $this->choice('What\'s the indicated position for this candidate?', ['junior', 'mid', 'senior', 'lead', 'other']); - } + $this->indicatedPosition = $this->menu('What\'s the indicated position for this candidate?', ['junior', 'mid', 'senior', 'lead', 'other'], 'other')->disableDefaultItems()->open(); $this->info('Closing interview environment for ' . $this->candidateName); @@ -341,7 +350,7 @@ private function postActionHooks() $score = 0; DB::update( 'UPDATE code_server_instances SET hire_recommendation_level = ?, position_level_recommendation = ?, general_score = ? WHERE id = ?', - [$this->hireRecommendation, $this->indicatedPosition, $score, $this->interviewId] + [$this->hireRecommendation, $this->indicatedPosition, $score, $this->interviewId] ); diff --git a/app/Commands/CreateInterviewCommand.php b/app/Commands/CreateInterviewCommand.php index 61c7a75..28db694 100644 --- a/app/Commands/CreateInterviewCommand.php +++ b/app/Commands/CreateInterviewCommand.php @@ -19,7 +19,7 @@ class CreateInterviewCommand extends Command * * @var string */ - protected $signature = 'init {name : The candidate name (required)}'; + protected $signature = 'init {name? : The candidate name (required)}'; /** * The description of the command. @@ -59,7 +59,14 @@ public function handle() $this->line($this->getApplication()->getName()); $candidateName = $this->argument('name'); + + if(!$candidateName || empty($candidateName)){ + $candidateName = $this->ask('Please enter the candidate name'); + } + $candidateName = str_replace(' ', '_', $candidateName); + + $this->info('Creating interview environment for ' . $candidateName); $this->candidateName = $candidateName;