baby frontend soundin good
This commit is contained in:
@@ -37,11 +37,16 @@ gitlab() (
|
||||
local url="$1"
|
||||
local url_path="${url#http*://gitlab*.net/}"
|
||||
local project="${url_path%%/-/*}"
|
||||
local project="${project%%/tree/*}"
|
||||
local root="${url_path#*$project}"
|
||||
local root="${root#*/-/}"
|
||||
local root="${root#tree/}"
|
||||
local root="${root#blob/}"
|
||||
local root="${root#*/}"
|
||||
local root="${root#*/-}"
|
||||
if [ "$root" != "${root#/tree}" ]; then
|
||||
root="${root#/tree}"
|
||||
root="/${root#/*/}"
|
||||
fi
|
||||
local root="${root#/blob}"
|
||||
local root="${root#/}"
|
||||
log project=$project, root=$root, url=$url
|
||||
echo "$project"
|
||||
echo "$root"
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ EOF
|
||||
}
|
||||
|
||||
test_url_to_project_root() {
|
||||
gitlab _url_to_project_root https://gitlab-app.eng.qops.net/data-store/orchestration/runbooks/tree/master | grep -q '^data-store/orchestration/runbooks$'
|
||||
gitlab _url_to_project_root https://gitlab-app.eng.qops.net/data-store/orchestration/runbooks/tree/master | tail -n 1 | grep ^$
|
||||
|
||||
gitlab _url_to_project_root https://gitlab-app.eng.qops.net/data-store/orchestration/runbooks/-/blob/master/Alerts/rems/README.md | grep -q 'data-store/orchestration/runbooks'
|
||||
gitlab _url_to_project_root https://gitlab-app.eng.qops.net/data-store/orchestration/runbooks/-/blob/master/Alerts/rems/README.md | grep -q 'Alerts/rems/README.md'
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ each() {
|
||||
source ./cache.sh
|
||||
set -e
|
||||
set -o pipefail
|
||||
log() { echo "> $*" >&2; }
|
||||
}
|
||||
|
||||
if [ "$0" == "$BASH_SOURCE" ]; then
|
||||
|
||||
Reference in New Issue
Block a user