Skip to content

Instantly share code, notes, and snippets.

@utamas
Created May 27, 2015 17:00
Show Gist options
  • Save utamas/c0468c602834a8bde604 to your computer and use it in GitHub Desktop.
Save utamas/c0468c602834a8bde604 to your computer and use it in GitHub Desktop.
fetchArchive() {
local host=$1
local token=$2
local projectId=$3
if [[ -z "$host" ]] || [[ -z "$token" ]] || [[ -z "$projectId" ]]; then
echo
echo "Usage: $FUNCNAME <host> <gitlab account token> <project id>"
echo
return 1
fi
curl -o ~/archive.zip -L $host/api/v3/projects/$projectId/repository/archive.zip?private_token=$token
return $?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment