From a7334ca0249f220bae2d21ca31127e2af8589ee4 Mon Sep 17 00:00:00 2001 From: Stanisław Zagórowski Date: Mon, 15 Jan 2024 15:03:41 +0100 Subject: cdn: fix script --- cdn.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cdn.sh b/cdn.sh index 7422243..f158540 100755 --- a/cdn.sh +++ b/cdn.sh @@ -5,7 +5,7 @@ # 1. Delete the old CDN branch # 2. Create a new CDN branch # 3. Remove all files except public/* -# 4. Copy public/* to the CDN branch +# 4. Move public/* to the CDN branch # 5. Commit and push the CDN branch # # Print progress along the way @@ -19,14 +19,15 @@ echo "[2/5] Creating new CDN branch, moving all files to it" git checkout -b cdn echo "[3/5] Removing all files except public/*" -dirs=$(find . -maxdepth 1 -type d -not -name public -not -name .git -not -name . -not -name ..) +dirs=$(ls | grep -v public) for dir in $dirs; do echo "Removing $dir" rm -rf $dir done -echo "[4/5] Copying public/* to CDN branch" -cp -r public/* . +echo "[4/5] Moving public/* to CDN branch" +mv public/* . +rmdir public echo "[5/5] Committing and pushing CDN branch" git add -A -- cgit v1.3.1