automagically make git passwords work

This commit is contained in:
stupidcomputer 2024-07-22 15:36:37 -05:00
parent bd1731aae8
commit f98acbb12a
2 changed files with 20 additions and 1 deletions

View File

@ -3,7 +3,10 @@
name = stupidcomputer
[credential "https://git.beepboop.systems"]
username = stupidcomputer
helper = !git-rbw-wrap gitea
[credential "https://github.com"]
helper = !git-rbw-wrap github-pat
[advice]
addIgnoredFile = false

16
builds/utils/git-rbw-wrap Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
[ -z "$1" ] && exit 1
# wrap rbw get $1 --full to output in the git credential helper
# format
# username=yourusername
# password=yourpassword
output=$(rbw get $1 --full)
echo "$output" | \
sed '1{s/^/password=/}' | \
sed 's/Username: /username=/g' | \
grep -E 'username|password' | \
tac