cross platform!

This commit is contained in:
LuKe Tidd 2023-05-18 18:40:35 -04:00
parent 1db8502819
commit f0957ceb7b
Signed by: luke
GPG Key ID: 75D6600BEF4E8E8F
4 changed files with 10 additions and 4 deletions

8
gclone
View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
if [[ -z "$1" ]]; then if [[ -z "$1" ]]; then
printf 'Need a project:\n\n' >&2 printf 'Need a project:\n\n' >&2
pass show gitea/token >&2 pass show gitea/token >&2
@ -24,7 +24,13 @@ if [[ "$project" == 'pass' ]]; then
pass git pull "token_url" pass git pull "token_url"
else else
readarray -t out <<< "$(git clone "$token_url" 2>&1)" readarray -t out <<< "$(git clone "$token_url" 2>&1)"
printf 'out: %s\n' "${out[@]}"
new_dir="$(awk -F\' '{print $2}' <<< "$out")" new_dir="$(awk -F\' '{print $2}' <<< "$out")"
printf 'new dir: %s\n' "$new_dir"
if [[ -z "$new_dir" ]]; then
printf 'could not get dir from git clone.\n' >&2
exit 1
fi
cd "$new_dir" cd "$new_dir"
git config user.signingkey "$gpg_key"! git config user.signingkey "$gpg_key"!

2
gpull
View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
if [[ -z "$1" ]]; then if [[ -z "$1" ]]; then
project="$(basename $(pwd))" project="$(basename $(pwd))"

2
gpush
View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
if [[ -z "$1" ]]; then if [[ -z "$1" ]]; then
project="$(basename $(pwd))" project="$(basename $(pwd))"

2
link
View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
local_bins=( local_bins=(
"${HOME}/bin" "${HOME}/bin"