detect project from leaf dir if no project specified

This commit is contained in:
2022-11-18 16:45:01 -05:00
parent b9ab70213c
commit 2bf4e928dd
3 changed files with 29 additions and 27 deletions

6
gclone
View File

@@ -8,9 +8,12 @@ fi
project="$1"
shift
token="$(pass show gitea/token/${project})"
if [[ -z "$token" ]]; then
printf 'Failed to get token.\n'
printf 'Failed to get token for %s. ' "$project" >&2
print 'Must be one of:\n\n' "$project" >&2
pass show gitea/token >&2
exit 1
fi
token_url="https://luke:${token}@git.drheck.dev/luke/${project}.git"
@@ -37,4 +40,3 @@ else
git remote remove origin
git push --set-upstream "$url" main
fi