detect project from leaf dir if no project specified
This commit is contained in:
6
gclone
6
gclone
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user