From 3d9cfc2f95614bc5c066d6e2d2b413ad17162f83 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Tue, 1 Feb 2022 08:24:38 -0700 Subject: [PATCH] kinda unexported --- app/crawler/main.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/crawler/main.sh b/app/crawler/main.sh index 896a6e1..c3b1415 100644 --- a/app/crawler/main.sh +++ b/app/crawler/main.sh @@ -141,15 +141,15 @@ gitlab() ( echo "$*" | grep -q gitlab.app && ! echo "$*" | grep -q '/wiki/' } - gcurl() { - local cache_key="gitlab gcurl $*" + _gcurl() { + local cache_key="gitlab _gcurl $*" if cache get "$cache_key"; then return 0 fi - _gcurl "$@" | cache put "$cache_key" + __gcurl "$@" | cache put "$cache_key" } - _gcurl() { + __gcurl() { curl -sS -H "Authorization: Bearer $GITLAB_PAT" "$@" } @@ -163,12 +163,12 @@ gitlab() ( _expand() { local url="$1" - local project="$(url_to_project_root "$url" | head -n 1)" - local root="$(url_to_project_root "$url" | tail -n 1)" + local project="$(_url_to_project_root "$url" | head -n 1)" + local root="$(_url_to_project_root "$url" | tail -n 1)" __expand "$project" "$root" } - url_to_project_root() { + _url_to_project_root() { local url="$1" local url_path="${url#http*://gitlab*.net/}" local project="${url_path%%/-/*}" @@ -199,7 +199,7 @@ gitlab() ( | grep . } while [ "$i" -lt "${#b64_trees[@]}" ]; do - got="$(list_tree "$project" "${b64_trees[i]}")" + got="$(_list_tree "$project" "${b64_trees[i]}")" for b64_tree in $(find_each "tree" "$got"); do if ! echo "${b64_trees[@]}" | grep -q "[ ^]$b64_tree[ $]"; then b64_trees+=("$b64_tree") @@ -217,11 +217,11 @@ gitlab() ( done } - list_tree() { + _list_tree() { local project="$(urlencode "$1")" local path="/api/v4/projects/$project/repository/tree" local query="recursive=true&path=$2" - gcurl "https://gitlab-app.eng.qops.net/$path?$query" + _gcurl "https://gitlab-app.eng.qops.net/$path?$query" } "$@"