Add uploads folder to tar exclusion
This commit is contained in:
@@ -24,7 +24,7 @@ FILES_ONLY=false
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
-h|--help)
|
||||
-h | --help)
|
||||
cat "$SCRIPT_DIR/MANUAL"
|
||||
exit 0
|
||||
;;
|
||||
@@ -42,9 +42,9 @@ done
|
||||
# Function to add entry to .gitignore if not already present
|
||||
add_to_gitignore() {
|
||||
local entry="$1"
|
||||
cat .gitignore | grep "$entry" > /dev/null 2>&1
|
||||
cat .gitignore | grep "$entry" >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$entry" >> .gitignore
|
||||
echo "$entry" >>.gitignore
|
||||
echo -e "${BLUE}Added $entry to .gitignore${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}$entry already is inside of .gitignore file${NC}"
|
||||
@@ -125,9 +125,9 @@ echo "Starting project sync..."
|
||||
# Step 1: SSH into server and create tar archive
|
||||
echo "Creating archive on server..."
|
||||
if [ "$FILES_ONLY" = true ]; then
|
||||
sshpass -p "${SSH_PASSWORD}" ssh $SSH_OPTS ${SERVER_HOST} "cd ${SERVER_PROJECT_PATH} && tar -czf ../${ARCHIVE_NAME} --exclude='node_modules' --exclude='vendor' ."
|
||||
sshpass -p "${SSH_PASSWORD}" ssh $SSH_OPTS ${SERVER_HOST} "cd ${SERVER_PROJECT_PATH} && tar -czf ../${ARCHIVE_NAME} --exclude='node_modules' --exclude='vendor' --exclude='uploads' ."
|
||||
else
|
||||
sshpass -p "${SSH_PASSWORD}" ssh $SSH_OPTS ${SERVER_HOST} "cd ${SERVER_PROJECT_PATH} && tar -czf ../${ARCHIVE_NAME} ."
|
||||
sshpass -p "${SSH_PASSWORD}" ssh $SSH_OPTS ${SERVER_HOST} "cd ${SERVER_PROJECT_PATH} && tar -czf ../${ARCHIVE_NAME} --exclude='uploads' ."
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
@@ -232,10 +232,10 @@ for script in "${scripts[@]}"; do
|
||||
SERVER_PASSWORD=\"${SSH_PASSWORD}\"
|
||||
SERVER_PATH=\"${SERVER_PROJECT_PATH}/\"
|
||||
REMOTE_PROGRESS=\".remote-in-progress\"
|
||||
" > "${script}"
|
||||
" >"${script}"
|
||||
|
||||
# Append the rest of the upload core build script
|
||||
cat "${SCRIPT_DIR}/scripts/${script}" >> "${script}"
|
||||
cat "${SCRIPT_DIR}/scripts/${script}" >>"${script}"
|
||||
echo "${script} created successfully"
|
||||
|
||||
# Skip .gitignore updates when --sftp-only flag is present
|
||||
|
||||
Reference in New Issue
Block a user