aboutsummaryrefslogtreecommitdiff
path: root/cdn.sh
diff options
context:
space:
mode:
authorStanisław Zagórowski <hasohasacz@gmail.com>2024-01-15 15:03:41 +0100
committerStanisław Zagórowski <hasohasacz@gmail.com>2024-01-15 15:03:41 +0100
commita7334ca0249f220bae2d21ca31127e2af8589ee4 (patch)
tree3e5bf5a870d638d5c9b3c70b731051a8c0bb9611 /cdn.sh
parente1fac246098da4237c1503b8657c37ec8ee34174 (diff)
cdn: fix script
Diffstat (limited to 'cdn.sh')
-rwxr-xr-xcdn.sh9
1 files 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