Skip to content

Commit

Permalink
scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
valiantlynx committed Sep 18, 2024
1 parent 56972aa commit 4153eb3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/CatStatus.bcat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
28 changes: 28 additions & 0 deletions gh-pages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Define the name of the new branch
NEW_BRANCH="new-branch"

# Create and switch to the new branch
git checkout -b $NEW_BRANCH

# Perform the operations on the new branch
# Exclude the .git directory and .env file from deletion
find . -mindepth 1 -not -path "./build*" -not -path "./.git*" -not -name ".env" -exec rm -rf {} + 2>/dev/null

# Move files and hidden files from the build directory to the current directory
for file in build/.* build/*; do
[ -e "$file" ] && mv "$file" . 2>/dev/null
done

# Remove the build directory if it is empty
rmdir build 2>/dev/null

# Add changes to the new branch
git add .

# Commit the changes
git commit -m "Replace all contents with build folder contents except .env"

# Optionally, push the new branch to the remote repository
# git push origin $NEW_BRANCH

0 comments on commit 4153eb3

Please sign in to comment.