Skip to content

Commit

Permalink
update some for jump group
Browse files Browse the repository at this point in the history
Signed-off-by: inhere <in.798@qq.com>
  • Loading branch information
inhere committed Aug 4, 2021
1 parent 522b4a2 commit d033d65
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
matrix:
php: [7.3, 7.4, 8.0] # 7.2,
os: [ubuntu-latest, macOS-latest] # windows-latest,
include:
- os: 'ubuntu-latest'
php: '7.2'
phpunit: '8.5.13'
# include: # will not testing on php 7.2
# - os: 'ubuntu-latest'
# php: '7.2'
# phpunit: '8.5.13'

steps:
- name: Checkout
Expand Down Expand Up @@ -53,4 +53,8 @@ jobs:
# Docs: https://getcomposer.org/doc/articles/scripts.md

- name: Run test suite
run: php bin/kite -V
run: |
php bin/kite -V
php bin/kite -h
php bin/kite git info
14 changes: 13 additions & 1 deletion app/Common/Jump/JumpShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@ class JumpShell
echo \'$(kite jump hint "\$term")\'
}
{{bindFunc}}() {
local dir="$(kite jump cd "$@")"
local dir
dir="$(kite jump get "$@")"
test -d "\$dir" && cd "\$dir"
}
[[ "\$PROMPT_COMMAND" =~ __jump_prompt_command ]] || {
PROMPT_COMMAND="__jump_prompt_command;\$PROMPT_COMMAND"
}
complete -o dirnames -C '__jump_hint' {{bindFunc}}
# add alias for: kite jump
alias kj="kite jump"
BASH;

/**
Expand Down Expand Up @@ -91,8 +95,16 @@ class JumpShell
# compctl -U -K _jump_completion {{bindFunc}}
# for use `_describe`
compdef _jump_completion '{{bindFunc}}'
# add alias for: kite jump
alias kj="kite jump"
ZSH;

/**
* @param string $shell
*
* @return string
*/
public static function getShellScript(string $shell): string
{
if ($shell === self::NAME_BASH) {
Expand Down
9 changes: 5 additions & 4 deletions app/Console/Controller/JumpController.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,16 @@ protected function configure(): void
public function listCommand(Input $input, Output $output): void
{
$jd = $this->getQJDir();
$output->colored('Datafile: ' . $jd->getDatafile());
$output->colored('Datafile: ' . $jd->getDatafile(), 'cyan');

$key = $input->getFirstArg();
$data = $jd->getEngine()->toArray(true);

if ($key && isset($data[$key])) {
$data = $data[$key];
$output->aList($data[$key], $key);
} else {
$output->mList($data);
}

$output->mList($data);
}

/**
Expand Down

0 comments on commit d033d65

Please sign in to comment.