760 current 2024-06-21 14:47:22 24.11.20240621.1c0bec2 6.9.5-zen1 *
This commit is contained in:
parent
620f7b2532
commit
bdebfc484f
3 changed files with 78 additions and 9 deletions
21
packages/getgithost/default.nix
Normal file
21
packages/getgithost/default.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{writeShellScriptBin, ...}:
|
||||
writeShellScriptBin "getgithost" ''
|
||||
IFS="/"
|
||||
GIT_REMOTE=$(command git ls-remote --get-url 2> /dev/null)
|
||||
read -ra GIT_HOST <<< "$GIT_REMOTE"
|
||||
|
||||
if [[ "$GIT_REMOTE" =~ "github" ]]; then
|
||||
GIT_REMOTE_SYMBOL=" "
|
||||
elif [[ "$GIT_REMOTE" =~ "gitlab" ]]; then
|
||||
GIT_REMOTE_SYMBOL=" "
|
||||
elif [[ "$GIT_REMOTE" =~ "bitbucket" ]]; then
|
||||
GIT_REMOTE_SYMBOL=" "
|
||||
elif [[ "$GIT_REMOTE" =~ "git" ]]; then
|
||||
GIT_REMOTE_SYMBOL=" "
|
||||
else
|
||||
GIT_REMOTE_SYMBOL=" localhost"
|
||||
fi
|
||||
|
||||
echo "$GIT_REMOTE_SYMBOL''${GIT_HOST [2]}"
|
||||
IFS=" "
|
||||
''
|
||||
Loading…
Add table
Add a link
Reference in a new issue