Skip to content

Commit

Permalink
update some for scli version info
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Oct 11, 2019
1 parent 2dc1789 commit c1e289b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/Command/AssetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function publish(Input $input): int
$assetDir = alias($assetDir);
$targetDir = alias($targetDir);

$force = \input()->sameOpt(['f', 'force'], false);
$force = $input->sameOpt(['f', 'force'], false);

if ($force && is_dir($targetDir)) {
output()->writeln("Will delete the old assets: $targetDir");
Expand All @@ -91,7 +91,7 @@ public function publish(Input $input): int
}
}

$yes = \input()->sameOpt(['y', 'yes'], false);
$yes = $input->sameOpt(['y', 'yes'], false);
$command = "cp -Rf $assetDir $targetDir";

output()->writeln("Will run shell command:\n $command");
Expand Down
2 changes: 1 addition & 1 deletion app/Command/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Swoft\Cli\Command;

use Swoft;
use Swoft\Cli\Bean\ModifyWatcher;
use Swoft\Cli\Common\ModifyWatcher;
use Swoft\Cli\Helper\CliHelper;
use Swoft\Console\Annotation\Mapping\Command;
use Swoft\Console\Annotation\Mapping\CommandArgument;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace Swoft\Cli\Bean;
namespace Swoft\Cli\Common;

use RuntimeException;
use Swoft\Stdlib\Helper\Sys;
Expand Down
9 changes: 9 additions & 0 deletions app/Helper/CliHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,25 @@ class CliHelper
{
public const PREFIX = ' <cyan>[SWOFTCLI]</cyan>';

/**
* @param string $msg
*/
public static function info(string $msg): void
{
Show::writeln(date('Y/m/d-H:i:s') . self::PREFIX . " <info>$msg</info>");
}

/**
* @param string $msg
*/
public static function warn(string $msg): void
{
Show::writeln(date('Y/m/d-H:i:s') . self::PREFIX . " <warning>$msg</warning>");
}

/**
* @param string $msg
*/
public static function error(string $msg): void
{
Show::writeln(date('Y/m/d-H:i:s') . self::PREFIX . " <error>$msg</error>");
Expand Down
2 changes: 1 addition & 1 deletion app/SwoftCLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function afterInit(): void
public function getCLoggerConfig(): array
{
$config = parent::getCLoggerConfig();
// disable print console start log
// disable print console log
$config['enable'] = false;

return $config;
Expand Down
5 changes: 5 additions & 0 deletions app/bean.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
// use Swoft\Server\Swoole\SwooleEvent;

return [
'cliApp' => [
'name' => 'Swoft-cli',
'version' => '0.1.2',
'description' => 'CLI tool application for quick use swoft framework',
],
'cliRouter' => [
'idAliases' => [
// 'run' => 'serve:run'
Expand Down

0 comments on commit c1e289b

Please sign in to comment.