(command-line/website) that analyzes your repo code percentage and adds nice sections such as the correct install instructions to your Readme in a safe manner.
# not currently implemented npx readmegenerator
- get the organization and repo
url=$(git remote get-url origin) &&
suffix=$(basename $url) &&
organization=$(basename ${url%"$suffix"}) &&
repo=$(basename $url .git) &&
echo $organization $repo || echo 'something failed'
- get the languages for the project:
curl https://api.github.com/repos/michaeldimmitt/meetup-subscribe/languages
{
"JavaScript": 27686,
"HTML": 1586,
"CSS": 848
}
curl https://api.github.com/repos/michaeldimmitt/$dir/languages
- Check the Readme to see if it needs install instructions:
cat R*.md | grep "Setup\|Usage\|Install"
-
Calculate the percentages and determine if they are acceptable to add install instructions to the readme.
-
Download the winning Readme files:
cp R*.md AppendedReadme.md
curl -L https://raw.githubusercontent.com/MichaelDimmitt/readmegenerator/master/readmes/React.md >> AppendedReadme.md
curl -L https://raw.githubusercontent.com/MichaelDimmitt/readmegenerator/master/readmes/javascript.md >> AppendedReadme.md
echo 'Your readme is ready! check using:
cat AppendedReadme.md;
or accept the chages using:
mv AppendedReadme.md; Readme.md;
If you do not like the resulting git diff, undo our changes with git checkout Readme.md; 😘'
- get the name of the project:
dir=${PWD##*/}
echo $dir
- get the remote
# url=$(git remote -v | grep fetch | awk '{print $2}')
# $(git config --get remote.origin.url)
# this is not the correct url for api... maybe I will use gh_reveal's url parser to build the url.
https://github.com/MichaelDimmitt/automate-shared-markdown/blob/master/Readme.md