summaryrefslogtreecommitdiff
path: root/shell-scripts
diff options
context:
space:
mode:
authorMike Vink <mike1994vink@gmail.com>2023-04-29 12:11:28 +0200
committerMike Vink <mike1994vink@gmail.com>2023-04-29 12:11:28 +0200
commit66c69c98bbf01ca202cb29ace8f9654d1f2e5c1a (patch)
treed555d98d1321a442673a8d9198659fda55050a78 /shell-scripts
parentd0d9ebb6f77b6fdc39dfd617746c00b06471b12a (diff)
fixup
Diffstat (limited to 'shell-scripts')
-rw-r--r--shell-scripts/azdo-switch-project33
-rw-r--r--shell-scripts/gh-switch-project21
2 files changed, 0 insertions, 54 deletions
diff --git a/shell-scripts/azdo-switch-project b/shell-scripts/azdo-switch-project
deleted file mode 100644
index 2889e62..0000000
--- a/shell-scripts/azdo-switch-project
+++ /dev/null
@@ -1,33 +0,0 @@
-#!@bash@/bin/bash
-eval "$(pass show work/shell-scripts/secrets)"
-
-LIST_PROJECTS="/_apis/projects?api-version=7.1-preview.4"
-AUTH_HEADER="Authorization: Basic $WORK_AZDO_GIT_AUTH"
-LIST_REPOSITORIES="/_apis/git/repositories?api-version=7.1-preview.1"
-GIT_DIR="$HOME/projects/"
-if [ ! -d $GIT_DIR ]; then
- mkdir -p $GIT_DIR
-fi
-MAX_REPOS=20
-
-echo "curl -s -H \"$AUTH_HEADER\" $WORK_AZDO_GIT_ORG_URL$LIST_PROJECTS"
-PROJECT=$(curl -s -H "$AUTH_HEADER" $WORK_AZDO_GIT_ORG_URL$LIST_PROJECTS \
-| jq '
-.value[].name
-' \
-| xargs -I{} bash -c "
-curl -s -H '$AUTH_HEADER' $WORK_AZDO_GIT_ORG_URL/{}$LIST_REPOSITORIES \
-| jq '
-.value[].name
-' \
-| awk '{ gsub(/\"/, \"\", \$1); printf \"{}/_git/%s\\n\", \$1 }'
-" \
-| fzf)
-
-DEST_DIR="$GIT_DIR/$(echo $PROJECT | cut -d '/' -f3)"
-if [ ! -d $DEST_DIR ]
-then
- git clone --bare $WORK_AZDO_GIT_ORG_URL/$PROJECT $DEST_DIR
-fi
-cd $DEST_DIR
-$EDITOR
diff --git a/shell-scripts/gh-switch-project b/shell-scripts/gh-switch-project
deleted file mode 100644
index 9f460d9..0000000
--- a/shell-scripts/gh-switch-project
+++ /dev/null
@@ -1,21 +0,0 @@
-#!@bash@/bin/bash
-eval "$(pass show personal/shell-scripts/secrets)"
-repo=$(gh repo list --json owner,name -q '.[] | "\(.owner.login)/\(.name)"' | fzf --print-query -1)
-GIT_DIR="$HOME/projects"
-if [ ! -d $GIT_DIR ]; then
- mkdir -p $GIT_DIR
-fi
-
-if [[ "$(echo "$repo" | wc -l)" -ne 1 ]]; then
- echo "Fetching my repo"
- repo="$(echo "$repo" | tail -n1)"
-fi
-
-DEST_DIR="$GIT_DIR/$(echo $repo | cut -d '/' -f2)"
-if [ ! -d $DEST_DIR ]
-then
- gh repo clone $repo $DEST_DIR -- --bare
-fi
-cd $DEST_DIR
-git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
-$EDITOR