From b52f1d44860162a1647d37c7a96067c83dc6ac60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sat, 23 Nov 2024 06:50:26 +0200 Subject: [PATCH] Add secondary Infra repo path to Infra command --- src/commands/infra.sh | 15 +++++++++++++-- wx | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/commands/infra.sh b/src/commands/infra.sh index fbf753f..e595800 100644 --- a/src/commands/infra.sh +++ b/src/commands/infra.sh @@ -5,10 +5,21 @@ wx-infra(){ wx-header "Infra" wx-restricted - INFRA_PATH="/home/cwchristerw/Desktop/Work in Progress/Programming/warengroup/infra" - case $USERNAME in cwchristerw) + if [[ -d "/home/cwchristerw/Desktop/Work in Progress/Programming/warengroup/infra" ]] + then + INFRA_PATH="/home/cwchristerw/Desktop/Work in Progress/Programming/warengroup/infra" + else + if [[ -d "~/.warengroup/infra" ]] + then + INFRA_PATH="~/.warengroup/infra" + else + INFRA_PATH="~/.warengroup/infra" + git clone ssh://git@git.waren.io:2222/warengroup-private/infra.git --config core.sshCommand="ssh -i ~/.ssh/keys/warengroup-legacy" "$INFRA_PATH" + fi + fi + if [[ -z $1 ]] then echo "Tag Required" diff --git a/wx b/wx index e301d56..cffcbed 100755 --- a/wx +++ b/wx @@ -138,10 +138,21 @@ wx-infra(){ wx-header "Infra" wx-restricted - INFRA_PATH="/home/cwchristerw/Desktop/Work in Progress/Programming/warengroup/infra" - case $USERNAME in cwchristerw) + if [[ -d "/home/cwchristerw/Desktop/Work in Progress/Programming/warengroup/infra" ]] + then + INFRA_PATH="/home/cwchristerw/Desktop/Work in Progress/Programming/warengroup/infra" + else + if [[ -d "~/.warengroup/infra" ]] + then + INFRA_PATH="~/.warengroup/infra" + else + INFRA_PATH="~/.warengroup/infra" + git clone ssh://git@git.waren.io:2222/warengroup-private/infra.git --config core.sshCommand="ssh -i ~/.ssh/keys/warengroup-legacy" "$INFRA_PATH" + fi + fi + if [[ -z $1 ]] then echo "Tag Required"