From 8b3ab29bfec810b77f11b0cae1d9e63837b9a80a Mon Sep 17 00:00:00 2001
From: Recolic K <bensl@microsoft.com>
Date: Mon, 2 Aug 2021 16:03:11 +0800
Subject: [PATCH] s

---
 README.md   | 4 ++--
 aur-sync.sh | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 53fdbb5..519dbab 100644
--- a/README.md
+++ b/README.md
@@ -15,9 +15,9 @@ docker build -t your-name/pikaur .
 
 2. Put this directory to your server. Assume you're placing this directory to `/srv/my-mirror-site`
 
-3. Create a directory `mirrors/output` (you can name it as anything you want), and modify the `build_outdir` variable in aur-sync.sh. Also change the `recolic-aur` after the `repo-add` command, to your repo name. 
+3. Modify the `build_outdir` and `repo_name` variable in aur-sync.sh. 
 
-You should know how to publish the directory to your web server. 
+You should know how to publish the output directory with your web server. 
 
 4. Add a crontab line and enjoy! 
 
diff --git a/aur-sync.sh b/aur-sync.sh
index 72035a7..218d856 100755
--- a/aur-sync.sh
+++ b/aur-sync.sh
@@ -21,7 +21,8 @@ repo_upstreams=(
 aur_upstreams='pikaur frpc frps azure-cli unzip-iconv create_ap snakesocks teamviewer remarkable goland clion gnome-terminal-transparency'
 # intellij-idea-ce rider graftcp # gractcp failure
 
-build_outdir="mirrors/recolic-aur"
+build_outdir="mirrors/aur"
+repo_name=recolic-aur
 
 function sync_aur () {
     echo "Running aur autobuild..."
@@ -71,11 +72,11 @@ function dedup_and_build_index () {
     cd -
 
     # build index.db
-    sudo docker run -i --rm -v "$(pwd)/$build_outdir":/home/builder/.cache/pikaur/pkg recolic/pikaur      bash -c "chown builder -R /home/builder/.cache/pikaur/pkg && cd /home/builder/.cache/pikaur/pkg && repo-add recolic-aur.db.tar.gz *.pkg.tar.*"
+    sudo docker run -i --rm -v "$(pwd)/$build_outdir":/home/builder/.cache/pikaur/pkg recolic/pikaur      bash -c "chown builder -R /home/builder/.cache/pikaur/pkg && cd /home/builder/.cache/pikaur/pkg && repo-add $repo_name.db.tar.gz *.pkg.tar.*"
     return $?
 }
 
-
+mkdir -p "$build_outdir"
 sync_aur || echo AUR-gg
 sync_repo || echo REPO-gg
 sync_http || echo HTTP-gg
-- 
GitLab