Skip to content

Instantly share code, notes, and snippets.

@vjrj
Last active May 13, 2019 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vjrj/772c5149d1e07d91041b260851401ef3 to your computer and use it in GitHub Desktop.
Save vjrj/772c5149d1e07d91041b260851401ef3 to your computer and use it in GitHub Desktop.
An small script to format a row for LA Node Components
#!/bin/bash
# Sample usage:
# $ la-components-table-row.sh "Elurikkus - Estonia" https://elurikkus.ee/en https://elurikkus.ee/en/collections/ https://elurikkus.ee/generic-hub/ https://elurikkus.ee/biocache-service/ https://elurikkus.ee/bie-hub/ https://elurikkus.ee/bie-index/ https://elurikkus.ee/lists/ https://elurikkus.ee/regions/
# to get:
# | [Elurikkus - Estonia](https://elurikkus.ee/en) | [✓](https://elurikkus.ee/en/collections/) | [✓](https://elurikkus.ee/generic-hub/) | [✓](https://elurikkus.ee/biocache-service/) | [✓](https://elurikkus.ee/bie-hub/) | [✓](https://elurikkus.ee/bie-index/) | [✓](https://elurikkus.ee/lists/) | [✓](https://elurikkus.ee/regions/) |
# Order:
# | NodeName | Collectory | Biocache | BiocacheService | Species | SpeciesService | SpeciesLists | Regions | Images | Spatial | CAS | Sightings | Alerts | Volunteer |
function p {
if [[ $1 != "x" ]] ; then echo -n "| [✓]($1) " ; else echo -n "| "; fi
}
echo -n "| [$1]($2) "; for var in "${@:3}" ; do p $var; done; echo "|"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment