This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#!/bin/dash
|
||||
set -eu
|
||||
|
||||
. "$LOG_SH"
|
||||
. "$GITEA_SH"
|
||||
|
||||
export GITEA_ADMIN_TOKEN_FILE="$GCR_STATE_DIR/admin-token"
|
||||
export GCR_GITEA_URL='https://gitea.example.test'
|
||||
printf 'test-token\n' > "$GITEA_ADMIN_TOKEN_FILE"
|
||||
gcr_gitea_admin_token() { printf 'test-token'; }
|
||||
|
||||
gcr_gitea_curl() {
|
||||
output=""
|
||||
previous=""
|
||||
for arg do
|
||||
if [ "$previous" = -o ]; then
|
||||
output="$arg"
|
||||
fi
|
||||
previous="$arg"
|
||||
done
|
||||
case "$*" in
|
||||
*'/orgs/yukkop/repos'*)
|
||||
: > "$output"
|
||||
printf '404'
|
||||
;;
|
||||
*'/users/yukkop/repos'*)
|
||||
printf '[{"full_name":"yukkop/project"}]\n' > "$output"
|
||||
printf '200'
|
||||
;;
|
||||
*'/orgs/hectic-lab/repos'*)
|
||||
printf '[{"full_name":"hectic-lab/util.nix"}]\n' > "$output"
|
||||
printf '200'
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
test "$(gcr_gitea_list_owner_repos yukkop)" = 'yukkop/project'
|
||||
test "$(gcr_gitea_list_owner_repos hectic-lab)" = 'hectic-lab/util.nix'
|
||||
Reference in New Issue
Block a user