Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/inhere/kite
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Jul 11, 2022
2 parents 30b01de + 0ebbb23 commit 14f0eb1
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 141 deletions.
5 changes: 5 additions & 0 deletions app/Console/Command/EnvCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Inhere\Console\IO\Output;
use Toolkit\Stdlib\OS;
use function is_scalar;
use function ucfirst;

/**
* Class DemoCommand
Expand Down Expand Up @@ -53,8 +54,12 @@ protected function execute(Input $input, Output $output)
if ($name) {
$value = null;
$upKey = strtoupper($name);
// fix: in windows, ENV 'PATH' is 'Path'
$upFKey = ucfirst($name);
if (isset($_SERVER[$upKey])) {
$value = $_SERVER[$upKey];
} elseif (isset($_SERVER[$upFKey])) {
$value = $_SERVER[$upFKey];
} elseif (isset($_SERVER[$name])) {
$value = $_SERVER[$name];
}
Expand Down
8 changes: 4 additions & 4 deletions app/Console/simple-cmds.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
$name = $fs->getArg('binName');
$path = Sys::findExecutable($name);
if (!$path) {
$output->println('Not found');
$output->println('Not found in PATH');
return;
}

$clean = $fs->getOpt('clean');
$output->colored($clean ? $path : "Path: $path");
// $clean = $fs->getOpt('clean');
$output->colored($path);
}, [
'desc' => 'find bin file path, like system `which`',
'aliases' => ['where', 'whereis'],
'options' => [
'--clean' => 'bool;clean output, only output path.'
// '--clean' => 'bool;clean output, only output path.'
],
'arguments' => [
'binName' => 'string;the target bin file name for find;true',
Expand Down
Loading

0 comments on commit 14f0eb1

Please sign in to comment.