update deploy.sh
This commit is contained in:
parent
d33fcf26c9
commit
0f8ad2ba20
@ -23,7 +23,12 @@ build() {
|
|||||||
|
|
||||||
setup_gh() {
|
setup_gh() {
|
||||||
# Delete the branch if it exists, and create a new one
|
# Delete the branch if it exists, and create a new one
|
||||||
git branch -D "$PAGES_BRANCH"
|
if git show-ref --verify --quiet "refs/heads/$PAGES_BRANCH"; then
|
||||||
|
echo "Branch '$PAGES_BRANCH' exists. Deleting it..."
|
||||||
|
git branch -D "$PAGES_BRANCH" # Delete the local branch
|
||||||
|
else
|
||||||
|
echo "Branch '$PAGES_BRANCH' does not exist locally. Skipping deletion."
|
||||||
|
fi
|
||||||
|
|
||||||
# Create and switch to the new branch
|
# Create and switch to the new branch
|
||||||
git checkout -b "$PAGES_BRANCH"
|
git checkout -b "$PAGES_BRANCH"
|
||||||
|
@ -25,10 +25,8 @@ if Dir.exist?(destination_dir)
|
|||||||
puts "Deleted: #{file_path}"
|
puts "Deleted: #{file_path}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
puts "All files have been removed from #{destination_dir}."
|
|
||||||
else
|
else
|
||||||
FileUtils.mkdir_p(destination_dir)
|
FileUtils.mkdir_p(destination_dir)
|
||||||
puts "Directory #{destination_dir} does not exist."
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Copy all files and directories while preserving the structure
|
# Copy all files and directories while preserving the structure
|
||||||
|
Loading…
x
Reference in New Issue
Block a user