diff --git a/.github/workflows/update-repo.yml b/.github/workflows/update-repo.yml index abeb60b..daab656 100644 --- a/.github/workflows/update-repo.yml +++ b/.github/workflows/update-repo.yml @@ -22,36 +22,66 @@ jobs: - name: Update Repository Database run: | cd x86_64 - # Rebuild the DB (Manual tar to ensure compatibility) + # Rebuild the DB tar -cvzf hyprarch-repo.db.tar.gz *.pkg.tar.zst + # Ensure a files archive exists + cp hyprarch-repo.db.tar.gz hyprarch-repo.files.tar.gz - # Fix symlinks for GitHub Pages + # Fix symlinks for GitHub Pages (actual files instead of symlinks) rm -f hyprarch-repo.db hyprarch-repo.files cp hyprarch-repo.db.tar.gz hyprarch-repo.db cp hyprarch-repo.files.tar.gz hyprarch-repo.files - name: Generate Python-style Index run: | - # 1. Create index for x86_64 folder + # 1. Create the BASIC PYTHON-STYLE index for the x86_64 folder cd x86_64 - echo "Index of /x86_64/" > index.html + echo "Index of /x86_64/" > index.html echo "

Index of /x86_64/


" >> index.html
           echo "../" >> index.html
           for file in *; do
             if [ "$file" != "index.html" ]; then
               size=$(du -sh "$file" | cut -f1)
               date=$(date -r "$file" '+%d-%b-%Y %H:%M')
-              echo "$file$(printf '%*s' $((50 - ${#file})) '') $date    $size" >> index.html
+              # Formatted alignment for the directory listing
+              printf "%s%-$(($(printf '%s' "$file" | wc -c) > 50 ? 1 : 50 - $(printf '%s' "$file" | wc -c)))s %s %8s\n" "$file" "$file" "" "$date" "$size" >> index.html
             fi
           done
           echo "

" >> index.html - # 2. Create index for the Root folder + # 2. Create the STYLED landing page for the Root folder cd .. - echo "Index of /" > index.html - echo "

Index of /


" >> index.html
-          echo "x86_64/" >> index.html
-          echo "

" >> index.html + cat < index.html + + + + HyprArch Repository + + + +
+

🚀 HyprArch Custom Repository

+

To use this repository, add these lines to the bottom of your /etc/pacman.conf:

+
[hyprarch-repo]\nSigLevel = Optional TrustAll\nServer = https://hyprarch-repo.stuple.net/\$arch
+ +

📦 Available Packages

+ +
+

Database last updated: $(date -u '+%Y-%m-%d %H:%M:%S') UTC

+
+ + + EOF - name: Commit and Push changes run: | @@ -59,7 +89,7 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" git add . if ! git diff-index --quiet HEAD; then - git commit -m "Automated database and index update" + git commit -m "Automated database and hybrid index update" git push else echo "Nothing to change."