From 3db78cdda904f28f2b61688154e84d507d0081f5 Mon Sep 17 00:00:00 2001 From: Luke Tidd Date: Fri, 18 Nov 2022 16:51:57 -0500 Subject: [PATCH] remove unused extra args that would conflict with an implied repo --- gclone | 16 ++++------------ gcommit | 3 --- gpull | 14 +++----------- gpush | 12 ++---------- 4 files changed, 9 insertions(+), 36 deletions(-) delete mode 100755 gcommit diff --git a/gclone b/gclone index a1fac87..aedfe87 100755 --- a/gclone +++ b/gclone @@ -16,27 +16,19 @@ if [[ -z "$token" ]]; then pass show gitea/token >&2 exit 1 fi + +gpg_key='75D6600BEF4E8E8F' token_url="https://luke:${token}@git.drheck.dev/luke/${project}.git" url="https://luke@git.drheck.dev/luke/${project}.git" if [[ "$project" == 'pass' ]]; then - if [[ -n "$@" ]]; then - pass git pull "$@" "$token_url" - else - pass git pull "token_url" - fi + pass git pull "token_url" else - if [[ -n "$@" ]]; then - readarray -t out <<< "$(git clone "$@" "$token_url" 2>&1)" - else - readarray -t out <<< "$(git clone "$token_url" 2>&1)" - fi + readarray -t out <<< "$(git clone "$token_url" 2>&1)" new_dir="$(awk -F\' '{print $2}' <<< "$out")" cd "$new_dir" - gpg_key='75D6600BEF4E8E8F' git config user.signingkey "$gpg_key"! git config commit.gpgsign true - git remote remove origin git push --set-upstream "$url" main fi diff --git a/gcommit b/gcommit deleted file mode 100755 index 0dfdf98..0000000 --- a/gcommit +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -printf 'git commit -S -m "YOUR_COMMIT_MESSAGE"\n' diff --git a/gpull b/gpull index 8eb8510..b42f54c 100755 --- a/gpull +++ b/gpull @@ -13,22 +13,14 @@ if [[ -z "$token" ]]; then pass show gitea/token >&2 exit 1 fi +gpg_key='75D6600BEF4E8E8F' url="https://luke:${token}@git.drheck.dev/luke/${project}.git" if [[ "$project" == 'pass' ]]; then pass git config user.signingkey "$gpg_key"! pass git config commit.gpgsign true - if [[ -n "$@" ]]; then - pass git pull "$@" "$url" - else - pass git pull "$url" - fi + pass git pull "$url" else - gpg_key='75D6600BEF4E8E8F' git config user.signingkey "$gpg_key"! git config commit.gpgsign true - if [[ -n "$@" ]]; then - git pull "$@" "$url" - else - git pull "$url" - fi + git pull "$url" fi diff --git a/gpush b/gpush index 361e3e0..cceca08 100755 --- a/gpush +++ b/gpush @@ -18,17 +18,9 @@ url="https://luke:${token}@git.drheck.dev/luke/${project}.git" if [[ "$project" == 'pass' ]]; then pass git config user.signingkey "$gpg_key"! pass git config commit.gpgsign true - if [[ -n "$@" ]]; then - pass git push "$@" "$url" - else - pass git push "$url" - fi + pass git push "$url" else git config user.signingkey "$gpg_key"! git config commit.gpgsign true - if [[ -n "$@" ]]; then - git push "$@" "$url" - else - git push "$url" - fi + git push "$url" fi