/ commit.sh
commit.sh
1 #!/bin/sh 2 3 mkdir ../init && cd ../init && cp -R ../targetdir/* ./ 4 5 # Initialize git repository (in current directory /var/lib/radicle/init) 6 git init 7 8 # Set git global config 9 git config --global user.email "you@example.com" 10 git config --global user.name "Your Name" 11 12 # Increase buffer size 13 git config --global http.postBuffer 524288000 14 15 # FIRST: Add Pictures and readme.md, then commit 16 git add Pictures readme.md extract-vid.sh recompile-vid.sh commit.sh 17 git commit -m "Initial commit: Pictures and readme" 18 19 # THEN: Run rad init 20 rad init 21 22 sleep 20 23 24 rad self 25 26 sleep 20 27 28 rad node status 29 30 sleep 10 31 32 # Process existing chk folders only (POSIX sh compatible) 33 set -- chk 34 35 total=$# 36 i=1 37 38 while [ $i -le $total ]; do 39 chk_folder="output/$1" 40 echo "Processing $chk_folder ($i/$total)" 41 42 # Add the specific chk folder 43 git add "$chk_folder" 44 45 # Commit if there are changes 46 if git diff --cached --quiet; then 47 echo "- No changes in $chk_folder, skipping commit and push" 48 else 49 git commit -m "." 50 echo "✓ Committed $chk_folder" 51 52 # Push immediately after each commit 53 git push rad 54 echo "🚀 Pushed $chk_folder to rad" 55 sleep 10 56 rad sync 57 sleep 5 58 rad sync status 59 fi 60 61 shift # Move to next argument 62 63 # Wait 20 minutes between iterations (except after last) 64 if [ $i -lt $total ]; then 65 echo "⏳ Waiting 20 minutes before next..." 66 sleep 120 67 fi 68 69 i=`expr $i + 1` 70 done 71 72 echo "✅ Completed all $total chk folders (with per-commit pushes)!"