Skip to content

Instantly share code, notes, and snippets.

@PythonCoderAS
Created May 21, 2022 19:48
Show Gist options
  • Select an option

  • Save PythonCoderAS/5f8e6c9f9c4719b53a5837ca958753a7 to your computer and use it in GitHub Desktop.

Select an option

Save PythonCoderAS/5f8e6c9f9c4719b53a5837ca958753a7 to your computer and use it in GitHub Desktop.
Get markdown URL for Github Repo #github #markdown
#!/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