mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Added the ability to browse GitHub files.
This commit is contained in:
parent
304530d990
commit
1a3940b9a3
2 changed files with 10 additions and 4 deletions
|
|
@ -5,7 +5,7 @@
|
|||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
local remote branches branch current_branch url
|
||||
local remote branches branch current_branch file url
|
||||
|
||||
remote="${1:-origin}"
|
||||
url=$(
|
||||
|
|
@ -18,6 +18,7 @@ branches=($(
|
|||
))
|
||||
current_branch="$(git-branch)"
|
||||
branch="${2:-master}"
|
||||
file="$3"
|
||||
|
||||
if [[ -z "$2" ]]; then
|
||||
if (( $branches[(I)$current_branch] != 0 )); then
|
||||
|
|
@ -28,7 +29,7 @@ if [[ -z "$2" ]]; then
|
|||
fi
|
||||
|
||||
if [[ -n "$url" ]]; then
|
||||
url="${url}/tree/${branch}"
|
||||
url="${url}/tree/${branch}/${file}"
|
||||
|
||||
if (( $+commands[$BROWSER] )); then
|
||||
"$BROWSER" "$url"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue