Skip to content

Instantly share code, notes, and snippets.

@yuuichi-fujioka
Created September 23, 2014 08:07
Show Gist options
  • Save yuuichi-fujioka/34d2baec7428f92d22d1 to your computer and use it in GitHub Desktop.
Save yuuichi-fujioka/34d2baec7428f92d22d1 to your computer and use it in GitHub Desktop.
curl for gitlab api
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/"$@"
}
Copy link

ghost commented Jun 26, 2015

What are use cases for this script? Can this script be used to read a repo snippet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment