Skip to content

Commit 5526479

Browse files
committed
git-glab-pipe: support passing of -g & -c args to git-gitlab
1 parent e23a0bd commit 5526479

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

git-glab-pipe.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
11
#!/bin/sh
22

3-
# TODO:
4-
# check args for cfg file
53
if [ "x$1" = "x--remote" ]; then
64
git_repo="$1 $2"
75
shift 2
86
fi
7+
8+
pre_cmd_args=""
9+
# FIXME: robust processing of selected pre gitlab command args.
10+
for i in 1 2; do
11+
case $1 in
12+
-g|--gitlab|-c|--config-file)
13+
pre_cmd_args="$pre_cmd_args $1 $2"
14+
shift 2
15+
;;
16+
*)
17+
break
18+
;;
19+
esac
20+
done
21+
922
# last pipeline:
1023
pipeid=$(git gitlab $git_repo project-pipeline list | head -n 1 | cut -d: -f2)
1124
[ -n "$pipeid" ] || exit 0
12-
git gitlab $git_repo -o yaml -f id,status,web_url project-pipeline get --id $pipeid
25+
git gitlab $git_repo $pre_cmd_args -o yaml -f id,status,web_url project-pipeline get --id $pipeid
1326

14-
git gitlab $git_repo -o yaml -f id,name,status,web_url project-pipeline-job list --pipeline-id $pipeid
27+
git gitlab $git_repo $pre_cmd_args -o yaml -f id,name,status,web_url project-pipeline-job list --pipeline-id $pipeid
1528

1629
#projurl=$(echo $url | sed "s#:\($proj\)#/\\1#")
1730
#projurl=$(echo $projurl | sed 's#git@#https://#')

0 commit comments

Comments
 (0)