-
Notifications
You must be signed in to change notification settings - Fork 3
feat(shell): open and complete project_open projects anywhere under ~/Code #204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cf2b9ed
feat(shell): add `project_open` autocomplete
codepuncher de95141
fix(shell): hash-key cache, sort scan, return 0 from completion
codepuncher a849512
refactor(shell): drop project_open theme target and redundant targets…
codepuncher e4701ac
refactor(shell): scan projects in a single find pass instead of recur…
codepuncher c77bdbc
refactor(shell): scan projects at fixed category/project depth via .git
codepuncher 3e774f2
fix(shell): drop dead project_open_scan argument flagged by shellcheck
codepuncher 746477b
fix(shell): sort project_open targets and return success from complet…
codepuncher 0678c70
chore(test): convert project_open suite to bats and run it in ci
codepuncher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| [submodule "tests/bats"] | ||
| path = tests/bats | ||
| url = https://github.com/bats-core/bats-core.git | ||
| [submodule "tests/test_helper/bats-support"] | ||
| path = tests/test_helper/bats-support | ||
| url = https://github.com/bats-core/bats-support.git | ||
| [submodule "tests/test_helper/bats-assert"] | ||
| path = tests/test_helper/bats-assert | ||
| url = https://github.com/bats-core/bats-assert.git | ||
| [submodule "tests/test_helper/bats-file"] | ||
| path = tests/test_helper/bats-file | ||
| url = https://github.com/bats-core/bats-file.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #compdef project_open po | ||
|
|
||
| # Autoloaded via $fpath so compinit (re)registers it on every run, surviving | ||
| # the repeated/deferred compinit calls in zshrc. Discovery helpers live in | ||
| # shell/aliases and are available in the interactive shell. | ||
|
|
||
| # Succeed with no candidates if the discovery helpers (from shell/aliases) aren't | ||
| # loaded yet, so zsh doesn't treat this as a failed completer. | ||
| (( $+functions[_project_open_projects] )) || return 0 | ||
|
|
||
| local -a candidates | ||
|
|
||
| if (( CURRENT == 2 )); then | ||
| candidates=("${(@f)$(_project_open_projects)}") | ||
| compadd -- "${candidates[@]}" | ||
| return 0 | ||
| fi | ||
|
|
||
| if (( CURRENT == 3 )); then | ||
| candidates=("${(@f)$(_project_open_targets "${words[CURRENT-1]}")}") | ||
| compadd -- "${candidates[@]}" | ||
| return 0 | ||
| fi | ||
|
codepuncher marked this conversation as resolved.
|
||
|
|
||
| return 0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.