Created
September 23, 2014 08:07
-
-
Save yuuichi-fujioka/34d2baec7428f92d22d1 to your computer and use it in GitHub Desktop.
curl for gitlab api
This file contains hidden or 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
function gitlabcurl() { | |
TOKEN=$GITLAB_TOKEN | |
URL=$GITLAB_URL | |
if [ -z $TOKEN ] | |
then | |
echo GITLAB_TOKEN is required in env | |
return 1 | |
fi | |
if [ -z $URL ] | |
then | |
echo GITLAB_URL is required in env | |
return 1 | |
fi | |
curl -H "PRIVATE-TOKEN: ${TOKEN}" ${URL}/api/v3/"$@" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What are use cases for this script? Can this script be used to read a repo snippet?