remove unused extra args that would conflict with an implied repo

This commit is contained in:
LuKe Tidd 2022-11-18 16:51:57 -05:00
parent 2bf4e928dd
commit 3db78cdda9
4 changed files with 9 additions and 36 deletions

16
gclone
View File

@ -16,27 +16,19 @@ if [[ -z "$token" ]]; then
pass show gitea/token >&2 pass show gitea/token >&2
exit 1 exit 1
fi fi
gpg_key='75D6600BEF4E8E8F'
token_url="https://luke:${token}@git.drheck.dev/luke/${project}.git" token_url="https://luke:${token}@git.drheck.dev/luke/${project}.git"
url="https://luke@git.drheck.dev/luke/${project}.git" url="https://luke@git.drheck.dev/luke/${project}.git"
if [[ "$project" == 'pass' ]]; then if [[ "$project" == 'pass' ]]; then
if [[ -n "$@" ]]; then pass git pull "token_url"
pass git pull "$@" "$token_url"
else
pass git pull "token_url"
fi
else else
if [[ -n "$@" ]]; then readarray -t out <<< "$(git clone "$token_url" 2>&1)"
readarray -t out <<< "$(git clone "$@" "$token_url" 2>&1)"
else
readarray -t out <<< "$(git clone "$token_url" 2>&1)"
fi
new_dir="$(awk -F\' '{print $2}' <<< "$out")" new_dir="$(awk -F\' '{print $2}' <<< "$out")"
cd "$new_dir" cd "$new_dir"
gpg_key='75D6600BEF4E8E8F'
git config user.signingkey "$gpg_key"! git config user.signingkey "$gpg_key"!
git config commit.gpgsign true git config commit.gpgsign true
git remote remove origin git remote remove origin
git push --set-upstream "$url" main git push --set-upstream "$url" main
fi fi

View File

@ -1,3 +0,0 @@
#!/bin/bash
printf 'git commit -S -m "YOUR_COMMIT_MESSAGE"\n'

14
gpull
View File

@ -13,22 +13,14 @@ if [[ -z "$token" ]]; then
pass show gitea/token >&2 pass show gitea/token >&2
exit 1 exit 1
fi fi
gpg_key='75D6600BEF4E8E8F'
url="https://luke:${token}@git.drheck.dev/luke/${project}.git" url="https://luke:${token}@git.drheck.dev/luke/${project}.git"
if [[ "$project" == 'pass' ]]; then if [[ "$project" == 'pass' ]]; then
pass git config user.signingkey "$gpg_key"! pass git config user.signingkey "$gpg_key"!
pass git config commit.gpgsign true pass git config commit.gpgsign true
if [[ -n "$@" ]]; then pass git pull "$url"
pass git pull "$@" "$url"
else
pass git pull "$url"
fi
else else
gpg_key='75D6600BEF4E8E8F'
git config user.signingkey "$gpg_key"! git config user.signingkey "$gpg_key"!
git config commit.gpgsign true git config commit.gpgsign true
if [[ -n "$@" ]]; then git pull "$url"
git pull "$@" "$url"
else
git pull "$url"
fi
fi fi

12
gpush
View File

@ -18,17 +18,9 @@ url="https://luke:${token}@git.drheck.dev/luke/${project}.git"
if [[ "$project" == 'pass' ]]; then if [[ "$project" == 'pass' ]]; then
pass git config user.signingkey "$gpg_key"! pass git config user.signingkey "$gpg_key"!
pass git config commit.gpgsign true pass git config commit.gpgsign true
if [[ -n "$@" ]]; then pass git push "$url"
pass git push "$@" "$url"
else
pass git push "$url"
fi
else else
git config user.signingkey "$gpg_key"! git config user.signingkey "$gpg_key"!
git config commit.gpgsign true git config commit.gpgsign true
if [[ -n "$@" ]]; then git push "$url"
git push "$@" "$url"
else
git push "$url"
fi
fi fi