Merge pull request #103 from infosiftr/generate-repo-stub-readme

Add script to generate stub README for docker-library repos
This commit is contained in:
Tianon Gravi 2014-11-14 16:41:58 -07:00
commit d1e1d21652
1 changed files with 31 additions and 0 deletions

31
generate-repo-stub-readme.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
set -e
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
repo="$1"
if [ -z "$repo" ]; then
echo >&2 'error: no repo specified'
cat >&2 <<EOUSAGE
usage: $0 repo [> README.md]
ie: $0 php > ../php/README.md
This script generates a stub README to standard out for the specified repo.
EOUSAGE
exit 1
fi
gitRepo='https://github.com/docker-library/docs'
hubPage="https://registry.hub.docker.com/_/$repo/"
cat <<EOREADME
# About this Repo
This is the Git repo of the official Docker image for [$repo]($hubPage). See the
Hub page for the full readme on how to use the Docker image and for information
regarding contributing and issues.
The full readme is generated over in [docker-library/docs]($gitRepo),
specificially in [docker-library/docs/$repo]($gitRepo/tree/master/$repo).
EOREADME