Created
May 21, 2022 19:48
-
-
Save PythonCoderAS/5f8e6c9f9c4719b53a5837ca958753a7 to your computer and use it in GitHub Desktop.
Get markdown URL for Github Repo #github #markdown
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
| #!/bin/bash | |
| DEFAULT="PythonCoderAS" # Change this to your username on GitHub. | |
| function getURL(){ | |
| # Usage: getURL <repo name> [optional display name] | |
| REPO="$1" | |
| DISPLAY="${2:-$1}" | |
| if [[ "$REPO" == *"/"* ]]; then | |
| # Do nothing | |
| else | |
| REPO="$DEFAULT/$REPO" | |
| fi | |
| printf "[%s](https://github.com/%s)" "$DISPLAY" "$REPO" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment