added generate_repos_markdown_table.sh
41a655bd
Hari Sekhon
committed
1 changed file
generate_repos_markdown_table.sh
/generate_repos_markdown_table.sh+39
/generate_repos_markdown_table.sh
Add comment 1 Plus  #!/usr/bin/env bash
Add comment 2 Plus  # vim:ts=4:sts=4:sw=4:et
Add comment 3 Plus  #
Add comment 4 Plus  # Author: Hari Sekhon
Add comment 5 Plus  # Date: 2024-07-11 17:02:15 +0200 (Thu, 11 Jul 2024)
Add comment 6 Plus  #
Add comment 7 Plus  # https///github.com/HariSekhon/Kubernetes-configs
Add comment 8 Plus  #
Add comment 9 Plus  # License: see accompanying Hari Sekhon LICENSE file
Add comment 10 Plus  #
Add comment 11 Plus  # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
Add comment 12 Plus  #
Add comment 13 Plus  # https://www.linkedin.com/in/HariSekhon
Add comment 14 Plus  #
Add comment 15 Plus  
Add comment 16 Plus  # Generates the GitHub Markdown table of repos in the README.md and Helm reading in https///github.com/HariSekhon/Knowledge-Base
Add comment 17 Plus  
Add comment 18 Plus  set -euo pipefail
Add comment 19 Plus  [ -n "${DEBUG:-}" ] && set -x
Add comment 20 Plus  srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Add comment 21 Plus  
Add comment 22 Plus  cd "$srcdir"
Add comment 23 Plus  
Add comment 24 Plus  if uname -s | grep -q Darwin; then
Add comment 25 Plus   sed(){
Add comment 26 Plus   gsed "$@"
Add comment 27 Plus   }
Add comment 28 Plus  fi
Add comment 29 Plus  
Add comment 30 Plus  {
Add comment 31 Plus  
Add comment 32 Plus  echo "| Repo Label | URL |"
Add comment 33 Plus  echo "| --- | --- |"
Add comment 34 Plus  sed 's/#.*//; /^[[:digit:]]*$/d' helm-repos.txt |
Add comment 35 Plus  sed 's/^/| /; s/ \+/ | /; s/$/|/'
Add comment 36 Plus  
Add comment 37 Plus  } |
Add comment 38 Plus  pandoc -t gfm
Add comment 39 Plus