This commit is contained in:
2022-11-18 16:13:18 -05:00
parent 6f2bd20e67
commit 498c89dc27
4 changed files with 97 additions and 1 deletions

30
gpull Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
if [[ -z "$1" ]]; then
printf 'Need a project:\n\n' >&2
pass show gitea/token >&2
exit 1
fi
project="$1"
shift
unset token
token="$(pass show gitea/token/${project})"
if [[ -z "$token" ]]; then
printf 'Failed to get token.\n'
exit 1
fi
url="https://luke:${token}@git.drheck.dev/luke/${project}.git"
if [[ "$project" == 'pass' ]]; then
if [[ -n "$@" ]]; then
pass git pull "$@" "$url"
else
pass git pull "$url"
fi
else
if [[ -n "$@" ]]; then
git pull "$@" "$url"
else
git pull "$url"
fi
fi