Last active
March 25, 2019 18:23
-
-
Save greg0ire/a404831add1247d2bc20fa11107c5d5e to your computer and use it in GitHub Desktop.
How to quickly provide a markdown help test for people who want to test your PR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Assumes you are in the directory of a Composer project, on the branch of your | |
# PR, and that the PR is on Github | |
function usage() | |
{ | |
echo "Usage: $1 nickname" | |
echo "Example: $1 greg0ire" | |
exit 1 | |
} | |
function main() | |
{ | |
cat << 'EOHEADER' | |
# How can I test this? | |
```shell | |
EOHEADER | |
cat << EOBODY | |
composer config repositories.$1 vcs https://github.com/$1/$(basename "$PWD") | |
composer require $(composer show --self --no-ansi \ | |
|grep 'name ' \ | |
|cut -d ':' -f 2 \ | |
|cut -b 2-) "dev-$(git rev-parse --abbrev-ref HEAD) as $(git describe --abbrev=0 --tags)" | |
EOBODY | |
cat << 'EOFOOTER' | |
``` | |
EOFOOTER | |
} | |
if [ $# -ne 1 ] | |
then | |
usage "$0" | |
fi | |
main "$1" |
Woops, didn't see your comment until now, fixed, thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@greg0ire the following will work on Mac OS (probably other BSDs), most probably on Linuxes as well: