Refactor script building / add to gitignore / 2 new scripts
This commit is contained in:
@@ -120,46 +120,38 @@ echo "{
|
||||
|
||||
echo -e "${GREEN}.vscode/sftp.json created successfully${NC}"
|
||||
|
||||
# Add upload core build script
|
||||
# Add variables to upload core script
|
||||
echo "
|
||||
#!/bin/bash
|
||||
set -e
|
||||
# Go through scripts, add variables and add them to project folder
|
||||
scripts=("upload-core-build.sh" "watch-core-build.sh" "local-remote.sh" "remote-local.sh" "sftp-watch.sh")
|
||||
|
||||
# Configuration
|
||||
SERVER_USER=\"${USERNAME}\"
|
||||
SERVER_HOST=\"${HOST}\"
|
||||
SERVER_PASSWORD=\"${SSH_PASSWORD}\"
|
||||
SERVER_PATH=\"${SERVER_PROJECT_PATH}/public\" # Public folders location on server
|
||||
" > upload-core-build.sh
|
||||
for script in "${scripts[@]}"; do
|
||||
# Add variables to script
|
||||
echo "
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Append the rest of the upload core build script
|
||||
cat "${SCRIPT_DIR}/upload-core-build.sh" >> upload-core-build.sh
|
||||
# Configuration
|
||||
SERVER_USER=\"${USERNAME}\"
|
||||
SERVER_HOST=\"${HOST}\"
|
||||
SERVER_PASSWORD=\"${SSH_PASSWORD}\"
|
||||
SERVER_PATH=\"${SERVER_PROJECT_PATH}/\"
|
||||
" > "${script}"
|
||||
|
||||
echo -e "${GREEN}upload-core-build.sh created successfully${NC}"
|
||||
# Append the rest of the upload core build script
|
||||
cat "${SCRIPT_DIR}/scripts/${script}" >> "${script}"
|
||||
echo "${script} created successfully"
|
||||
|
||||
# Add watch core build script
|
||||
# Add variables to upload core script
|
||||
echo "
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Configuration
|
||||
SERVER_USER=\"${USERNAME}\"
|
||||
SERVER_HOST=\"${HOST}\"
|
||||
SERVER_PASSWORD=\"${SSH_PASSWORD}\"
|
||||
SERVER_PATH=\"${SERVER_PROJECT_PATH}/public\" # Public folders location on server
|
||||
" > watch-core-build.sh
|
||||
|
||||
# Append the rest of the watch core build script
|
||||
cat "${SCRIPT_DIR}/watch-core-build.sh" >> watch-core-build.sh
|
||||
|
||||
echo -e "${GREEN}watch-core-build.sh created successfully${NC}"
|
||||
# Add script to .gitignore
|
||||
echo "${script}" >> .gitignore
|
||||
echo -e "${BLUE}Added ${script} to .gitignore${NC}"
|
||||
done
|
||||
|
||||
# Upload lazygit to server
|
||||
echo "Uploading lazygit to server..."
|
||||
|
||||
cp "${SCRIPT_DIR}/lazygit" .
|
||||
sshpass -p "${SSH_PASSWORD}" scp "${SCRIPT_DIR}/lazygit" ${SERVER_HOST}:${SERVER_PROJECT_PATH}
|
||||
echo -e "${GREEN}lazygit uploaded successfully${NC}"
|
||||
|
||||
echo -e "${GREEN}lazygit uploaded successfully${NC}"
|
||||
# Add lazygit to .gitignore
|
||||
echo "lazygit" >> .gitignore
|
||||
echo -e "${BLUE}Added lazygit to .gitignore${NC}"
|
||||
|
||||
Reference in New Issue
Block a user