* Nano and timeout error fix #1 * Nano and timeout error fix #2 * Nano and timeout error fix #3 * Nano and timeout error fix #4 * Nano and timeout error fix #5 * Nano and timeout error fix #6 * Nano and timeout error fix #7 (plus css changes for hide buttons) * Nano and timeout error fix #8 (zoom method) * Nano zoom fix #9 * Nano zoom fix #10 * Nano zoom fix #11 * Nano zoom fix #12 * Nano zoom fix #13 * Nano zoom fix #14 * Nano zoom fix #15 * Nano zoom fix #16 (ssh-2-promise) * Nano zoom fix #17 (ssh-2-promise port fix) * Full return back to old code with minor fixes * Terminal size fix #18 (rows & cols fix) * Test ntfy build notification system * Silent resize cmds & Auto resize terminal #1 * Silent resize cmds & Auto resize terminal #2 * Docker build update * Docker build update #2 * Docker build update #3 * Docker build update #4 (cache and cleanup) * Docker build update #5 (cache and cleanup) * Docker build update #6 (cache and cleanup) * Docker build update #7 (final) * Docker build update #8 (nevermind not finanl) * Docker build update #9 (nevermind not finanl) * Docker build update #10 * Docker build update #10 (I hope final) * Docker build update #10 (actual final) * Release 1.0!!!! * Repo clean-up * Remove files ignored by .gitignore * Change project name, create logo, change README.md to be soon updated. * Update README.md #1 (also added MIT License) * Update README.md #2 * Update README.md #3 * Update README.md #4 * Update README.md #5 * Update README.md #6 * Update README.md #7 * Update README.md * Add images * Update image name * Update README.md * Final changes to release-1.0 * Update README.md * Update name (need to fix logo) * Final updates (I hope for real this time) * Fix web-socket timeout. * Fix timeout on close.
64 lines
1.4 KiB
Bash
64 lines
1.4 KiB
Bash
#!/bin/bash
|
|
|
|
# Check if the correct number of parameters is provided
|
|
if [ "$#" -ne 2 ]; then
|
|
echo "Usage: $0 <commit-message> <branch-name>"
|
|
exit 1
|
|
fi
|
|
|
|
# Assign parameters to variables
|
|
COMMIT_MESSAGE=$1
|
|
BRANCH_NAME=$2
|
|
|
|
# Ensure Git is using the credential helper for HTTPS
|
|
git config --global credential.helper store
|
|
|
|
# Check if the branch exists
|
|
BRANCH_EXISTS=$(git branch --list "$BRANCH_NAME")
|
|
|
|
if [ -z "$BRANCH_EXISTS" ]; then
|
|
echo "Branch '$BRANCH_NAME' does not exist. Creating it now..."
|
|
git checkout -b "$BRANCH_NAME"
|
|
if [ $? -ne 0 ]; then
|
|
echo "Failed to create branch '$BRANCH_NAME'."
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "Branch '$BRANCH_NAME' exists. Checking it out..."
|
|
git checkout "$BRANCH_NAME"
|
|
if [ $? -ne 0 ]; then
|
|
echo "Failed to checkout branch '$BRANCH_NAME'."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
# Check if there are any changes to commit
|
|
if git diff --quiet; then
|
|
echo "No changes to commit."
|
|
exit 0
|
|
fi
|
|
|
|
# Perform git operations
|
|
echo "Adding all changes..."
|
|
git add .
|
|
if [ $? -ne 0 ]; then
|
|
echo "Failed to add changes."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Committing changes with message: $COMMIT_MESSAGE"
|
|
git commit -m "$COMMIT_MESSAGE"
|
|
if [ $? -ne 0 ]; then
|
|
echo "Commit failed."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Pushing changes forcefully to branch: $BRANCH_NAME"
|
|
export GIT_ASKPASS=echo
|
|
git push -f origin "$BRANCH_NAME"
|
|
if [ $? -ne 0 ]; then
|
|
echo "Push failed."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Git operations completed successfully." |