diff --git a/.gitfield/.radicle-push-state b/.gitfield/.radicle-push-state index fd8a4aa..deca52c 100644 --- a/.gitfield/.radicle-push-state +++ b/.gitfield/.radicle-push-state @@ -1 +1 @@ -dfecd5c75ea8018ab15082f2201ac4b8dda7411e +5a181ca64cf2cd665dd410fe37dd81b61c1b72bb diff --git a/.gitfield/bitbucket.sigil.md b/.gitfield/bitbucket.sigil.md index 075f87b..fc14475 100644 --- a/.gitfield/bitbucket.sigil.md +++ b/.gitfield/bitbucket.sigil.md @@ -6,24 +6,24 @@ - **Local Repo Path**: `/home/mrhavens/tmpwork/git-sigil` - **Remote Label**: `bitbucket` - **Default Branch**: `master` -- **This Commit Date**: `2025-06-06 05:52:10` +- **This Commit Date**: `2025-06-06 05:51:12` --- ## ๐Ÿ“ฆ Commit Info -- **This Commit Timestamp**: `2025-06-06 05:52:10` -- **Last Commit SHA**: `e0305269ef8c3de783a5d32000fd087ab3c8032e` +- **This Commit Timestamp**: `2025-06-06 05:51:12` +- **Last Commit SHA**: `765171ce2d62556d9f270098b28449021236e395` - **Last Commit Message**: `Post-GitLab sync at 2025-06-06 05:49:34` - **Last Commit Author**: `Mark Randall Havens ` -- **Last Commit Date**: `Fri Jun 6 05:51:51 2025 -0500` -- **This Commit URL**: [https://bitbucket.org/thefoldwithin/git-sigil/commits/e0305269ef8c3de783a5d32000fd087ab3c8032e](https://bitbucket.org/thefoldwithin/git-sigil/commits/e0305269ef8c3de783a5d32000fd087ab3c8032e) +- **Last Commit Date**: `Fri Jun 6 05:51:01 2025 -0500` +- **This Commit URL**: [https://bitbucket.org/thefoldwithin/git-sigil/commits/765171ce2d62556d9f270098b28449021236e395](https://bitbucket.org/thefoldwithin/git-sigil/commits/765171ce2d62556d9f270098b28449021236e395) --- ## ๐Ÿ“Š Repo Status -- **Total Commits**: `682` +- **Total Commits**: `670` - **Tracked Files**: `64` - **Uncommitted Changes**: `No` - **Latest Tag**: `None` @@ -52,7 +52,7 @@ - **Running in Docker**: `No` - **Running in WSL**: `Yes` - **Virtual Machine**: `wsl` -- **System Uptime**: `up 4 hours, 49 minutes` +- **System Uptime**: `up 4 hours, 48 minutes` --- diff --git a/.gitfield/github.sigil.md b/.gitfield/github.sigil.md index 159ab08..c1ad454 100644 --- a/.gitfield/github.sigil.md +++ b/.gitfield/github.sigil.md @@ -6,24 +6,24 @@ - **Local Repo Path**: `/home/mrhavens/tmpwork/git-sigil` - **Remote Label**: `github` - **Default Branch**: `master` -- **This Commit Date**: `2025-06-06 05:52:24` +- **This Commit Date**: `2025-06-06 05:51:27` --- ## ๐Ÿ“ฆ Commit Info -- **This Commit Timestamp**: `2025-06-06 05:52:24` -- **Last Commit SHA**: `a765ce196b2420cb0148acb23288c100c17a3219` +- **This Commit Timestamp**: `2025-06-06 05:51:27` +- **Last Commit SHA**: `b567636f2818d22ed7a836ac7445b815fa03e142` - **Last Commit Message**: `Post-Bitbucket sync at 2025-06-06 05:49:34` - **Last Commit Author**: `Mark Randall Havens ` -- **Last Commit Date**: `Fri Jun 6 05:52:14 2025 -0500` -- **This Commit URL**: [https://github.com/mrhavens/git-sigil/commit/a765ce196b2420cb0148acb23288c100c17a3219](https://github.com/mrhavens/git-sigil/commit/a765ce196b2420cb0148acb23288c100c17a3219) +- **Last Commit Date**: `Fri Jun 6 05:51:17 2025 -0500` +- **This Commit URL**: [https://github.com/mrhavens/git-sigil/commit/b567636f2818d22ed7a836ac7445b815fa03e142](https://github.com/mrhavens/git-sigil/commit/b567636f2818d22ed7a836ac7445b815fa03e142) --- ## ๐Ÿ“Š Repo Status -- **Total Commits**: `684` +- **Total Commits**: `672` - **Tracked Files**: `64` - **Uncommitted Changes**: `No` - **Latest Tag**: `None` @@ -48,7 +48,7 @@ - **Running in Docker**: `No` - **Running in WSL**: `Yes` - **Virtual Machine**: `wsl` -- **System Uptime**: `up 4 hours, 50 minutes` +- **System Uptime**: `up 4 hours, 49 minutes` - **MAC Address**: `00:15:5d:86:d8:cc` - **Local IP**: `172.18.207.124` - **CPU Model**: `AMD A6-3420M APU with Radeon(tm) HD Graphics` diff --git a/.gitfield/gitlab.sigil.md b/.gitfield/gitlab.sigil.md index 0207581..1625833 100644 --- a/.gitfield/gitlab.sigil.md +++ b/.gitfield/gitlab.sigil.md @@ -6,24 +6,24 @@ - **Local Repo Path**: `/home/mrhavens/tmpwork/git-sigil` - **Remote Label**: `gitlab` - **Default Branch**: `master` -- **Repo Created**: `2025-06-06 05:51:49` +- **Repo Created**: `2025-06-06 05:50:59` --- ## ๐Ÿ“ฆ Commit Info -- **This Commit Timestamp**: `2025-06-06 05:51:49` -- **This Commit SHA**: `6f40e2c7c99ffcfdf263715e2b69dc8de4addabb` +- **This Commit Timestamp**: `2025-06-06 05:50:59` +- **This Commit SHA**: `4eaa128b8d998acf8ea2bb3e2023345b54a7c67f` - **Last Commit Message**: `Post-Forgejo sync at 2025-06-06 05:49:34` - **Last Commit Author**: `Mark Randall Havens ` -- **Last Commit Date**: `Fri Jun 6 05:51:40 2025 -0500` -- **This Commit URL**: [https://gitlab.com/mrhavens/git-sigil/-/commit/6f40e2c7c99ffcfdf263715e2b69dc8de4addabb](https://gitlab.com/mrhavens/git-sigil/-/commit/6f40e2c7c99ffcfdf263715e2b69dc8de4addabb) +- **Last Commit Date**: `Fri Jun 6 05:50:47 2025 -0500` +- **This Commit URL**: [https://gitlab.com/mrhavens/git-sigil/-/commit/4eaa128b8d998acf8ea2bb3e2023345b54a7c67f](https://gitlab.com/mrhavens/git-sigil/-/commit/4eaa128b8d998acf8ea2bb3e2023345b54a7c67f) --- ## ๐Ÿ“Š Repo Status -- **Total Commits**: `680` +- **Total Commits**: `668` - **Tracked Files**: `64` - **Uncommitted Changes**: `No` - **Latest Tag**: `None` @@ -48,7 +48,7 @@ - **Running in Docker**: `No` - **Running in WSL**: `Yes` - **Virtual Machine**: `wsl` -- **System Uptime**: `up 4 hours, 49 minutes` +- **System Uptime**: `up 4 hours, 48 minutes` - **MAC Address**: `00:15:5d:86:d8:cc` - **Local IP**: `172.18.207.124` - **CPU Model**: `AMD A6-3420M APU with Radeon(tm) HD Graphics` diff --git a/.gitfield/local.sigil.md b/.gitfield/local.sigil.md index c4204be..3d1e348 100644 --- a/.gitfield/local.sigil.md +++ b/.gitfield/local.sigil.md @@ -6,26 +6,26 @@ - **Local Repo Path**: `/home/mrhavens/tmpwork/git-sigil` - **Remote Label**: `local` - **Default Branch**: `master` -- **Repo Created**: `2025-06-06 06:21:43` +- **Repo Created**: `2025-06-06 05:51:28` --- ## ๐Ÿ“ฆ Commit Info -- **This Commit Timestamp**: `2025-06-06 06:21:43` -- **Last Commit SHA**: `f9a30495fd65bed41ba4e7de8e7443dd777c98c7` +- **This Commit Timestamp**: `2025-06-06 05:51:28` +- **Last Commit SHA**: `87be8e1f1a32571a9b9fadc8884e60735e0534c8` - **Last Commit Message**: `Post-GitHub sync at 2025-06-06 05:49:34` - **Last Commit Author**: `Mark Randall Havens ` -- **Last Commit Date**: `Fri Jun 6 05:52:26 2025 -0500` +- **Last Commit Date**: `Fri Jun 6 05:51:28 2025 -0500` - **This Commit URL**: `file:///home/mrhavens/git-local-repos/git-sigil.git` --- ## ๐Ÿ“Š Repo Status -- **Total Commits**: `686` +- **Total Commits**: `674` - **Tracked Files**: `64` -- **Uncommitted Changes**: `Yes` +- **Uncommitted Changes**: `No` - **Latest Tag**: `None` --- @@ -48,7 +48,7 @@ - **Running in Docker**: `No` - **Running in WSL**: `Yes` - **Virtual Machine**: `wsl` -- **System Uptime**: `up 5 hours, 18 minutes` +- **System Uptime**: `up 4 hours, 49 minutes` - **MAC Address**: `00:15:5d:86:d8:cc` - **Local IP**: `172.18.207.124` - **CPU Model**: `AMD A6-3420M APU with Radeon(tm) HD Graphics` diff --git a/.gitfield/push_log.json b/.gitfield/push_log.json index 06e78e7..d3f979d 100644 --- a/.gitfield/push_log.json +++ b/.gitfield/push_log.json @@ -62,12 +62,6 @@ "branch": "master", "commit": "87be8e1f1a32571a9b9fadc8884e60735e0534c8", "message": "Post-GitHub sync at 2025-06-06 05:49:34" - }, - { - "timestamp": "2025-06-06 06:21:43", - "branch": "master", - "commit": "f9a30495fd65bed41ba4e7de8e7443dd777c98c7", - "message": "Post-GitHub sync at 2025-06-06 05:49:34" } ] } diff --git a/.gitfield/pushed.log b/.gitfield/pushed.log index 3e9a590..271a2b9 100644 --- a/.gitfield/pushed.log +++ b/.gitfield/pushed.log @@ -63,11 +63,3 @@ [2025-06-06 05:51:35] Radicle: RID=rad:z3FEj7rF8gZw9eFksCuiN43qjzrex, Peer ID=z6Mkw5s3ppo26C7y7tGK5MD8n2GqTHS582PPpeX5Xqbu2Mpz CLI: rad inspect rad:z3FEj7rF8gZw9eFksCuiN43qjzrex # View project details CLI: git ls-tree -r --name-only HEAD # View file structure -[2025-06-06 05:51:40] Forgejo: https://remember.thefoldwithin.earth/mrhavens/git-sigil -[2025-06-06 05:51:51] GitLab: https://gitlab.com/mrhavens/git-sigil -[2025-06-06 05:52:14] Bitbucket: https://bitbucket.org/thefoldwithin/git-sigil -[2025-06-06 05:52:26] GitHub: https://github.com/mrhavens/git-sigil -[2025-06-06 06:21:44] Local: -[2025-06-06 06:21:48] Radicle: RID=rad:z3FEj7rF8gZw9eFksCuiN43qjzrex, Peer ID=z6Mkw5s3ppo26C7y7tGK5MD8n2GqTHS582PPpeX5Xqbu2Mpz - CLI: rad inspect rad:z3FEj7rF8gZw9eFksCuiN43qjzrex # View project details - CLI: git ls-tree -r --name-only HEAD # View file structure diff --git a/.gitfield/radicle.sigil.md b/.gitfield/radicle.sigil.md index 9f843b6..8321b63 100644 --- a/.gitfield/radicle.sigil.md +++ b/.gitfield/radicle.sigil.md @@ -2,28 +2,28 @@ - **Project Name**: `git-sigil` - **Radicle URN**: `rad://z3FEj7rF8gZw9eFksCuiN43qjzrex` -- **Public Gateway**: [https://app.radicle.xyz/nodes/ash.radicle.garden/rad:z3FEj7rF8gZw9eFksCuiN43qjzrex/tree/dfecd5c75ea8018ab15082f2201ac4b8dda7411e](https://app.radicle.xyz/nodes/ash.radicle.garden/rad:z3FEj7rF8gZw9eFksCuiN43qjzrex/tree/dfecd5c75ea8018ab15082f2201ac4b8dda7411e) +- **Public Gateway**: [https://app.radicle.xyz/nodes/ash.radicle.garden/rad:z3FEj7rF8gZw9eFksCuiN43qjzrex/tree/5a181ca64cf2cd665dd410fe37dd81b61c1b72bb](https://app.radicle.xyz/nodes/ash.radicle.garden/rad:z3FEj7rF8gZw9eFksCuiN43qjzrex/tree/5a181ca64cf2cd665dd410fe37dd81b61c1b72bb) - **Local Repo Path**: `/home/mrhavens/tmpwork/git-sigil` - **Default Branch**: `master` -- **Repo Created**: `2025-06-06 06:21:46` +- **Repo Created**: `2025-06-06 05:51:31` --- ## ๐Ÿ“ฆ Commit Info -- **This Commit Timestamp**: `2025-06-06 06:21:46` -- **Last Commit SHA**: `dfecd5c75ea8018ab15082f2201ac4b8dda7411e` -- **Last Commit Message**: `Post-Local sync at 2025-06-06 06:21:43` +- **This Commit Timestamp**: `2025-06-06 05:51:31` +- **Last Commit SHA**: `5a181ca64cf2cd665dd410fe37dd81b61c1b72bb` +- **Last Commit Message**: `Post-Local sync at 2025-06-06 05:49:34` - **Commit Author**: `Mark Randall Havens ` -- **Commit Date**: `Fri Jun 6 06:21:44 2025 -0500` -- **This Commit URL**: [https://app.radicle.xyz/nodes/ash.radicle.garden/rad:z3FEj7rF8gZw9eFksCuiN43qjzrex/tree/dfecd5c75ea8018ab15082f2201ac4b8dda7411e](https://app.radicle.xyz/nodes/ash.radicle.garden/rad:z3FEj7rF8gZw9eFksCuiN43qjzrex/tree/dfecd5c75ea8018ab15082f2201ac4b8dda7411e) +- **Commit Date**: `Fri Jun 6 05:51:29 2025 -0500` +- **This Commit URL**: [https://app.radicle.xyz/nodes/ash.radicle.garden/rad:z3FEj7rF8gZw9eFksCuiN43qjzrex/tree/5a181ca64cf2cd665dd410fe37dd81b61c1b72bb](https://app.radicle.xyz/nodes/ash.radicle.garden/rad:z3FEj7rF8gZw9eFksCuiN43qjzrex/tree/5a181ca64cf2cd665dd410fe37dd81b61c1b72bb) --- ## ๐Ÿ“Š Repo Status -- **Total Commits**: `688` -- **Tracked Files**: `63` +- **Total Commits**: `676` +- **Tracked Files**: `64` - **Uncommitted Changes**: `Yes` - **Latest Tag**: `None` @@ -47,7 +47,7 @@ - **Running in Docker**: `No` - **Running in WSL**: `Yes` - **Virtual Machine**: `wsl` -- **System Uptime**: `up 5 hours, 18 minutes` +- **System Uptime**: `up 4 hours, 49 minutes` - **MAC Address**: `00:15:5d:86:d8:cc` - **Local IP**: `172.18.207.124` - **CPU Model**: `AMD A6-3420M APU with Radeon(tm) HD Graphics` diff --git a/.gitfield/remember.sigil.md b/.gitfield/remember.sigil.md index 91fc301..4c1c4b5 100644 --- a/.gitfield/remember.sigil.md +++ b/.gitfield/remember.sigil.md @@ -6,25 +6,25 @@ - **Local Repo Path**: `/home/mrhavens/tmpwork/git-sigil` - **Remote Label**: `remember` - **Default Branch**: `master` -- **Repo Created**: `2025-06-06 06:21:49` +- **Repo Created**: `2025-06-06 05:51:37` --- ## ๐Ÿ“ฆ Commit Info -- **This Commit Timestamp**: `2025-06-06 06:21:49` -- **Last Commit SHA**: `22a9e269d72f11b33d925e352c1fa4658884f4aa` -- **Last Commit Message**: `Post-Radicle sync at 2025-06-06 06:21:43` +- **This Commit Timestamp**: `2025-06-06 05:51:37` +- **Last Commit SHA**: `e3ab0b87d902fd4ba7fb5c2e5926cd7c2a9a0857` +- **Last Commit Message**: `Post-Radicle sync at 2025-06-06 05:49:34` - **Last Commit Author**: `Mark Randall Havens ` -- **Last Commit Date**: `Fri Jun 6 06:21:48 2025 -0500` -- **This Commit URL**: [https://remember.thefoldwithin.earth/mrhavens/git-sigil/commit/22a9e269d72f11b33d925e352c1fa4658884f4aa](https://remember.thefoldwithin.earth/mrhavens/git-sigil/commit/22a9e269d72f11b33d925e352c1fa4658884f4aa) +- **Last Commit Date**: `Fri Jun 6 05:51:35 2025 -0500` +- **This Commit URL**: [https://remember.thefoldwithin.earth/mrhavens/git-sigil/commit/e3ab0b87d902fd4ba7fb5c2e5926cd7c2a9a0857](https://remember.thefoldwithin.earth/mrhavens/git-sigil/commit/e3ab0b87d902fd4ba7fb5c2e5926cd7c2a9a0857) --- ## ๐Ÿ“Š Repo Status -- **Total Commits**: `690` -- **Tracked Files**: `63` +- **Total Commits**: `678` +- **Tracked Files**: `64` - **Uncommitted Changes**: `No` - **Latest Tag**: `None` @@ -48,7 +48,7 @@ - **Running in Docker**: `No` - **Running in WSL**: `Yes` - **Virtual Machine**: `wsl` -- **System Uptime**: `up 5 hours, 18 minutes` +- **System Uptime**: `up 4 hours, 49 minutes` - **MAC Address**: `00:15:5d:86:d8:cc` - **Local IP**: `172.18.207.124` - **CPU Model**: `AMD A6-3420M APU with Radeon(tm) HD Graphics` diff --git a/bin/gitfield-sync b/bin/gitfield-sync index 4b07642..ef0da39 100755 --- a/bin/gitfield-sync +++ b/bin/gitfield-sync @@ -109,11 +109,11 @@ The following platforms host the \`$REPO_NAME\` repository, each chosen for its ### 2. Forgejo - **URL**: [$FORGEJO_URL]($FORGEJO_URL) -- **Purpose**: Forgejo is a self-hosted, open-source git platform running on \`remember.thefoldwithin.earth\`. It provides full control over the repository, ensuring sovereignty and independence from third-party providers. +- **Purpose**: Forgejo is a self-hosted, open-source git platform running on \`remember.thefoldwithin.earth\` (user: \`mrhavens\`, SSH port: 222). It provides full control over the repository, ensuring sovereignty and independence from third-party providers. - **Value**: Enhances resilience by hosting the repository on a sovereign, redundant system with automated backups and deployment strategies, reducing risks of external interference or service disruptions. - **Access Details**: SSH access uses port 222: \`\`\`bash - ssh -T -p 222 username@remember.thefoldwithin.earth + ssh -T -p 222 git@remember.thefoldwithin.earth \`\`\` ### 3. GitLab diff --git a/bin/gitfield-sync-bak b/bin/gitfield-sync-bak new file mode 100755 index 0000000..eed4cb9 --- /dev/null +++ b/bin/gitfield-sync-bak @@ -0,0 +1,233 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +# โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +# โ”‚ CONFIGURATION โ”‚ +# โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +REPO_PATH=$(git rev-parse --show-toplevel 2>/dev/null) || error "Not inside a Git repository" +REPO_NAME=$(basename "$REPO_PATH") +GITFIELD_DIR="$REPO_PATH/.gitfield" +LOG_FILE="$GITFIELD_DIR/pushed.log" +GITFIELD_MD="$REPO_PATH/GITFIELD.md" +TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S') +SCRIPT_VERSION="1.0" + +# URLs for each platform (derived from existing scripts) +GITHUB_URL="https://github.com/mrhavens/$REPO_NAME" +GITLAB_URL="https://gitlab.com/mrhavens/$REPO_NAME" +BITBUCKET_URL="https://bitbucket.org/thefoldwithin/$REPO_NAME" +RADICLE_RID="rad:z3FEj7rF8gZw9eFksCuiN43qjzrex" +RADICLE_PEER_ID="z6Mkw5s3ppo26C7y7tGK5MD8n2GqTHS582PPpeX5Xqbu2Mpz" + +# โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +# โ”‚ LOGGING UTILS โ”‚ +# โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +info() { echo -e "\e[1;34m[INFO]\e[0m $*" >&2; } +warn() { echo -e "\e[1;33m[WARN]\e[0m $*" >&2; } +error() { echo -e "\e[1;31m[ERROR]\e[0m $*" >&2; exit 1; } + +# โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +# โ”‚ SCRIPT LOOKUP FUNCTION โ”‚ +# โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +find_script() { + local script_name=$1 + local search_paths=( + "$HOME/.local/gitfieldbin" + "$HOME/.local/bin" + "$HOME/.local/gitfield" + "$HOME/.local/bin/gitfield" + "$HOME/.local/bin/gitfieldbin" + ) + + for path in "${search_paths[@]}"; do + if [ -f "$path/$script_name" ]; then + if [ -x "$path/$script_name" ]; then + if [[ "$path" != "$HOME"* ]]; then + info "Using script: \e[1;31m$path/$script_name\e[0m (outside home directory)" + else + info "Using script: $path/$script_name" + fi + echo "$path/$script_name" + return 0 + else + warn "Found $path/$script_name but it is not executable" + fi + fi + done + error "Script $script_name not found in any search path" +} + +# โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +# โ”‚ INITIAL SETUP โ”‚ +# โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +mkdir -p "$GITFIELD_DIR" + +if [ ! -f "$LOG_FILE" ]; then + echo "# Push Log for $REPO_NAME" > "$LOG_FILE" + echo "# Generated by gitfield-sync" >> "$LOG_FILE" + echo "" >> "$LOG_FILE" +fi + +# โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +# โ”‚ GENERATE GITFIELD.MD โ”‚ +# โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +generate_gitfield_md() { + info "Generating $GITFIELD_MD..." + cat > "$GITFIELD_MD" <> "$LOG_FILE" + echo " CLI: rad inspect $rid # View project details" >> "$LOG_FILE" + echo " CLI: git ls-tree -r --name-only HEAD # View file structure" >> "$LOG_FILE" + info "Logged push to $LOG_FILE: [$timestamp] $platform: RID=$rid, Peer ID=$peer_id" + else + echo "[$timestamp] $platform: $url" >> "$LOG_FILE" + info "Logged push to $LOG_FILE: [$timestamp] $platform: $url" + fi +} + +# โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +# โ”‚ EXECUTE PUSH SCRIPT โ”‚ +# โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +execute_push() { + local script_name=$1 + local platform=$2 + local url=$3 + local rid=$4 + local peer_id=$5 + local script_path + script_path=$(find_script "$script_name") || error "Failed to find $script_name" + info "Executing $platform push with script: $script_path" + if [ -x "$script_path" ]; then + pushd "$REPO_PATH" >/dev/null + "$script_path" || warn "Execution of $script_path failed, continuing..." + log_url "$platform" "$url" "$rid" "$peer_id" + git add . || warn "Nothing to add after $script_path" + git commit -m "Post-$platform sync at $TIMESTAMP" || warn "No changes to commit after $script_path" + popd >/dev/null + else + error "Script $script_path is not executable" + fi +} + +# โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +# โ”‚ RECURSIVE PUSH LOOP โ”‚ +# โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +run_push_cycle() { + local cycle_number=$1 + info "Starting push cycle $cycle_number..." + + execute_push "gitfield-local" "Local" "" "" "" + execute_push "gitfield-radicle" "Radicle" "" "$RADICLE_RID" "$RADICLE_PEER_ID" + execute_push "gitfield-gitlab" "GitLab" "$GITLAB_URL" "" "" + execute_push "gitfield-bitbucket" "Bitbucket" "$BITBUCKET_URL" "" "" + execute_push "gitfield-github" "GitHub" "$GITHUB_URL" "" "" +} + +# โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +# โ”‚ MAIN EXECUTION โ”‚ +# โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +info "Starting gitfield-sync for $REPO_NAME..." + +if [ ! -d "$REPO_PATH/.git" ]; then + pushd "$REPO_PATH" >/dev/null + git init + git add . + git commit -m "Initial commit" || warn "Nothing to commit" + popd >/dev/null +fi + +run_push_cycle 1 +generate_gitfield_md +run_push_cycle 2 +run_push_cycle 3 + +info "โœ… gitfield-sync completed successfully." +info "๐Ÿ”— View logs: $LOG_FILE" +info "๐Ÿ”— View multi-repo manifest: $GITFIELD_MD"