1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2025-12-12 15:34:50 +08:00

Compare commits

...

7 Commits

Author SHA1 Message Date
Marc Cornellà
4009668500 random: remove random theme from possible themes to choose from
...preventing an infinite loop.
2020-03-02 23:53:43 +01:00
Marc Cornellà
480f1ecd96 Merge branch 'update/jira-plugin'
Closes #6506
Closes #6950
Closes #7962
2020-03-02 23:41:09 +01:00
Josh Christopherson
587000ec02 Some tweaks to the Jira plugin
[x] Updating `branch` command to be compatible with git-flow style branches by removing any prefix before attempting to go to the ticket number in Jira.
[x] Removing the switch between /browse/ and /issues/ based off of the `JIRA_RAPID_BOARD` setting - as all issues are under browse now it seems.
2020-03-02 23:37:40 +01:00
Marc Cornellà
1f6e1555f2 Clean up jira function 2020-03-02 23:26:52 +01:00
RoToRx88
952200044d Better support for branch name
Enable to get issue from branch prefixed with it and delimited by '_'
2020-03-02 23:16:44 +01:00
Matthew Manuel
2f6d79b75d Uppercase the issue in open issue command in the JIRA plugin 2020-03-02 23:14:08 +01:00
Andrea Nanni
10ab2911d3
sdk: add support for local versions and optimize sed calls (#7870)
* Added support for local sdk versions

Added support for local versions (prefixed by '+'), so they are filtered out in _listInstallableVersions() and they are displayed correctly by _listAllVersion()

* Optimize sed calls

Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2020-03-02 16:19:48 +01:00
4 changed files with 27 additions and 15 deletions

View File

@ -23,6 +23,9 @@ jira reported [username] # queries for issues reported by a user
jira assigned [username] # queries for issues assigned to a user
jira myissues # queries for you own issues
jira branch # opens an existing issue matching the current branch name
# The branch name may have prefixes ending in "/": "feature/MP-1234",
# and also suffixes starting with "_": "MP-1234_fix_dashboard"
# In both these cases, the issue opened will be "MP-1234"
jira ABC-123 # opens an existing issue
jira ABC-123 m # opens an existing issue for adding a comment
```

View File

@ -63,26 +63,34 @@ function jira() {
else
# Anything that doesn't match a special action is considered an issue name
# but `branch` is a special case that will parse the current git branch
local issue_arg issue
if [[ "$action" == "branch" ]]; then
local issue_arg=$(git rev-parse --abbrev-ref HEAD)
local issue="${jira_prefix}${issue_arg}"
# Get name of the branch
issue_arg=$(git rev-parse --abbrev-ref HEAD)
# Strip prefixes like feature/ or bugfix/
issue_arg=${issue_arg##*/}
# Strip suffixes starting with _
issue_arg=(${(s:_:)issue_arg})
issue_arg=${issue_arg[1]}
if [[ "$issue_arg" = ${jira_prefix}* ]]; then
issue="${issue_arg}"
else
local issue_arg=$action
local issue="${jira_prefix}${issue_arg}"
issue="${jira_prefix}${issue_arg}"
fi
local url_fragment=''
else
issue_arg=${(U)action}
issue="${jira_prefix}${issue_arg}"
fi
local url_fragment
if [[ "$2" == "m" ]]; then
url_fragment="#add-comment"
echo "Add comment to issue #$issue"
else
echo "Opening issue #$issue"
fi
if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then
open_command "${jira_url}/issues/${issue}${url_fragment}"
else
open_command "${jira_url}/browse/${issue}${url_fragment}"
fi
fi
}
function _jira_url_help() {

View File

@ -51,12 +51,13 @@ _listInstalledVersions() {
}
_listInstallableVersions() {
__sdkman_list_versions $1 | grep "^ " | sed -e "s/\* /*/g" | \
sed -e "s/>//g" | xargs -n 1 echo | grep -v "^*"
# Remove local (+) and installed (*) versions from the list
__sdkman_list_versions $1 | sed -e '/^[^ ]/d;s/[+*] [^ ]\+//g;s/>//g'
}
_listAllVersion() {
__sdkman_list_versions $1 | grep "^ " | sed -e "s/\*/ /g" | sed -e "s/>//g"
# Remove (*), (+), and (>) characters from the list
__sdkman_list_versions $1 | sed -e '/^[^ ]/d;s/[*+>] //g'
}
_sdk () {

View File

@ -3,7 +3,7 @@ typeset -Ua themes
if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = array && ${#ZSH_THEME_RANDOM_CANDIDATES[@]} -gt 0 ]]; then
# Use ZSH_THEME_RANDOM_CANDIDATES if properly defined
themes=($ZSH_THEME_RANDOM_CANDIDATES)
themes=(${(@)ZSH_THEME_RANDOM_CANDIDATES:#random})
else
# Look for themes in $ZSH_CUSTOM and $ZSH and add only the theme name
themes=(
@ -12,7 +12,7 @@ else
"$ZSH"/themes/*.zsh-theme(N:t:r)
)
# Remove blacklisted themes from the list
for theme in ${ZSH_THEME_RANDOM_BLACKLIST[@]}; do
for theme in random ${ZSH_THEME_RANDOM_BLACKLIST[@]}; do
themes=("${(@)themes:#$theme}")
done
fi