760 current 2024-06-21 14:47:22 24.11.20240621.1c0bec2 6.9.5-zen1 *

This commit is contained in:
zackartz 2024-06-21 14:47:24 -04:00
parent 620f7b2532
commit bdebfc484f
No known key found for this signature in database
GPG key ID: 5B53E53A9A514DBA
3 changed files with 78 additions and 9 deletions

View 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=" "
''