restructure: flatten scripts dirs, remove roster, update SKILL.md

This commit is contained in:
lyn
2026-03-25 07:30:09 +00:00
parent b9785b6295
commit d358abf1ce
19 changed files with 62 additions and 92 deletions

View File

@@ -0,0 +1,49 @@
#!/bin/bash
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# Get username from ego-mgr
username=$(ego-mgr get default-username)
# Check if username is provided
if [[ -z "$username" ]]; then
echo "Error: default-username not set in ego-mgr, please contact ard"
exit 1
fi
# Parse arguments
while [[ $# -gt 0 ]]; do
case $1 in
--repo)
repo="$2"
shift 2
;;
--user)
user="$2"
shift 2
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
# Check if user and repo are provided
if [[ -z "$user" || -z "$repo" ]]; then
echo "Usage: $0 --user <user> --repo <repo>"
exit 1
fi
# Check if git-access-token exists
if ! secret-mgr list | grep -q "git-access-token"; then
echo "generate your access token first"
exit 1
fi
owner=$(secret-mgr get-username --key git)
token=$(secret-mgr get-secret --key git-access-token)
# Execute
curl -X PUT -H "Authorization: token $token" -H "Content-Type: application/json" -d '{"permission":"write"}' "https://git.hangman-lab.top/api/v1/repos/$owner/$repo/collaborators/$user"