We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63dc61c commit 32c2c0aCopy full SHA for 32c2c0a
updater/scripts/git-download.sh
@@ -2,12 +2,23 @@
2
#
3
# Calculate download traffic per day
4
5
+# Filter by a specific repository if $REPOSITORY is defined or replaced
6
+REPO_NAME="$REPOSITORY"
7
+
8
+if [ -n "$REPO_NAME" ]; then
9
+ # Escape forward slash
10
+ REPO_NAME="${REPO_NAME/\//\\/}"
11
12
+ REPO_NAME_FIELD="\"repo_name\":\"($REPO_NAME)\".*"
13
+else
14
+ REPO_NAME_FIELD='"repo_name":"([^"]+).*'
15
+fi
16
17
printf -v EXTRACT_FIELDS "%s" \
18
'print if s/.*' \
19
'"cloning":([^,]+).*' \
20
'"program":"upload-pack".*' \
- '"repo_name":"([^"]+).*' \
21
+ $REPO_NAME_FIELD \
22
'"uploaded_bytes":([^,]+).*' \
23
'"user_login":"([^"]+).*' \
24
'/\2\t\4\t\1\t\3/'
0 commit comments