moved and edited git folder scripts

This commit is contained in:
2026-09-08 20:31:18 -04:00
parent 97aca37663
commit cba7e16edc
4 changed files with 72 additions and 32 deletions

34
zip-git.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
shopt -s nullglob
matches=(worker-toolkit-*/repo)
shopt -u nullglob
if [ ${#matches[@]} -eq 0 ]; then
echo "No worker-toolkit-*/repo folder found, nothing to do." >&2
exit 1
fi
if [ ${#matches[@]} -gt 1 ]; then
echo "Multiple worker-toolkit-*/repo folders found, refusing to guess:" >&2
printf ' %s\n' "${matches[@]}" >&2
exit 1
fi
target="${matches[0]}"
if [ ! -d "$target/.git" ]; then
echo ".git folder not found in $target, nothing to do." >&2
exit 1
fi
(
cd "$target"
zip -rq GITFOLDER.zip .git
rm -rf .git
)
echo "Zipped .git into $target/GITFOLDER.zip and removed $target/.git folder."