Skip to content

Commit

Permalink
👔 up: add new dep toolkit/extlib and move cmd runner to extlib
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Mar 20, 2024
1 parent 53aabd4 commit 00837cb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 374 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.1, 8.2] # 7.2,7.4,8.0,
php: [8.1, 8.2, 8.3] # 7.2,7.4,8.0,
os: [ubuntu-latest, macOS-latest] # windows-latest,
# include: # will not testing on php 7.2
# - os: 'ubuntu-latest'
Expand Down
31 changes: 2 additions & 29 deletions app/Common/Cmd.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,11 @@

namespace Inhere\Kite\Common;

use Toolkit\Cli\Color;
use Toolkit\Sys\Cmd\CmdBuilder;

/**
* class Cmd builder
* @deprecated use \Toolkit\Extlib\Exec\Cmd
*/
class Cmd extends CmdBuilder
class Cmd extends \Toolkit\Extlib\Exec\Cmd
{
/**
* @param string $msg
* @param string $scene
*/
protected function printMessage(string $msg, string $scene): void
{
self::printByScene($msg, $scene);
}

/**
* @param string $msg
* @param string $scene
*/
public static function printByScene(string $msg, string $scene): void
{
$color = 'info';
if ($scene === self::PRINT_CMD) {
$color = 'yellow';
} elseif ($scene === self::PRINT_DRY_RUN) {
$color = 'cyan';
} elseif ($scene === self::PRINT_ERROR) {
$color = 'red';
}

Color::println($msg, $color);
}
}
Loading

0 comments on commit 00837cb

Please sign in to comment.