Skip to content

Commit

Permalink
Merge pull request #726 from cakephp/fix-725
Browse files Browse the repository at this point in the history
Check for potentially undefined command line argument
  • Loading branch information
markstory authored Jul 4, 2024
2 parents 3e3b537 + b095acf commit 364b0b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ jobs:
php-version: ['8.1', '8.2']
db-type: [mysql, pgsql, sqlite]
prefer-lowest: ['']
cake_version: ['']
include:
- php-version: '8.1'
db-type: 'sqlite'
prefer-lowest: 'prefer-lowest'
- php-version: '8.1'
db-type: 'sqlite'
cake_version: 'dev-5.next as 5.1.0'

services:
postgres:
Expand Down Expand Up @@ -89,6 +93,9 @@ jobs:
composer install --ignore-platform-req=php
elif ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then
composer update --prefer-lowest --prefer-stable
elif ${{ matrix.cake_version != '' }}; then
composer require --dev "cakephp/cakephp:${{ matrix.cake_version }}"
composer update
else
composer update
fi
Expand Down
5 changes: 4 additions & 1 deletion src/Migration/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,10 @@ public function getVersionsToMark(Arguments $args): array
$migrations = $this->getMigrations();
$versions = array_keys($migrations);

$versionArg = $args->getArgument('version');
$versionArg = null;
if ($args->hasArgument('version')) {
$versionArg = $args->getArgument('version');
}
$targetArg = $args->getOption('target');
$hasAllVersion = in_array($versionArg, ['all', '*'], true);
if ((empty($versionArg) && empty($targetArg)) || $hasAllVersion) {
Expand Down

0 comments on commit 364b0b0

Please sign in to comment.