restructure: flatten scripts dirs, remove roster, update SKILL.md
This commit is contained in:
30
git-hangman-lab/scripts/create-git-account
Executable file
30
git-hangman-lab/scripts/create-git-account
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get the directory where this script is located
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
# Get username and email from ego-mgr
|
||||
username=$(ego-mgr get default-username)
|
||||
email=$(ego-mgr get email)
|
||||
|
||||
# Check if username is provided
|
||||
if [[ -z "$username" ]]; then
|
||||
echo "Error: default-username not set in ego-mgr, please contact ard"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if email is provided
|
||||
if [[ -z "$email" ]]; then
|
||||
echo "Error: email not set in ego-mgr, please contact ard"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Generate git credentials (do not print secret)
|
||||
secret-mgr generate --username "$username" --key git >/dev/null
|
||||
|
||||
# Create gitea user
|
||||
"$SCRIPT_DIR/gitea" admin user create \
|
||||
--username "$(secret-mgr get-username --key git)" \
|
||||
--password "$(secret-mgr get-secret --key git)" \
|
||||
--email "$email" \
|
||||
--must-change-password=false
|
||||
Reference in New Issue
Block a user