add to gitignore gets checked
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
BLUE='\033[0;34m'
|
BLUE='\033[0;34m'
|
||||||
|
YELLOW='\033[0;33m'
|
||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
# Get current script real directory (follow symlinks)
|
# Get current script real directory (follow symlinks)
|
||||||
@@ -26,6 +27,18 @@ SCRIPT_PATH="$(realpath "$0")"
|
|||||||
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
|
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
|
||||||
ARCHIVE_NAME="leo.tar.gz"
|
ARCHIVE_NAME="leo.tar.gz"
|
||||||
|
|
||||||
|
# Function to add entry to .gitignore if not already present
|
||||||
|
add_to_gitignore() {
|
||||||
|
local entry="$1"
|
||||||
|
cat .gitignore | grep "$entry" > /dev/null 2>&1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "$entry" >> .gitignore
|
||||||
|
echo -e "${BLUE}Added $entry to .gitignore${NC}"
|
||||||
|
else
|
||||||
|
echo -e "${YELLOW}$entry already is inside of .gitignore file${NC}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
echo -e "${BLUE}=== Project Sync Configuration ===${NC}"
|
echo -e "${BLUE}=== Project Sync Configuration ===${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
@@ -162,8 +175,7 @@ for script in "${scripts[@]}"; do
|
|||||||
echo "${script} created successfully"
|
echo "${script} created successfully"
|
||||||
|
|
||||||
# Add script to .gitignore
|
# Add script to .gitignore
|
||||||
echo "${script}" >> .gitignore
|
add_to_gitignore "${script}"
|
||||||
echo -e "${BLUE}Added ${script} to .gitignore${NC}"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Upload lazygit to server
|
# Upload lazygit to server
|
||||||
@@ -174,5 +186,4 @@ sshpass -p "${SSH_PASSWORD}" scp "${SCRIPT_DIR}/lazygit" ${SERVER_HOST}:${SERVER
|
|||||||
echo -e "${GREEN}lazygit uploaded successfully${NC}"
|
echo -e "${GREEN}lazygit uploaded successfully${NC}"
|
||||||
|
|
||||||
# Add lazygit to .gitignore
|
# Add lazygit to .gitignore
|
||||||
echo "lazygit" >> .gitignore
|
add_to_gitignore "lazygit"
|
||||||
echo -e "${BLUE}Added lazygit to .gitignore${NC}"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user