1
0
mirror of https://github.com/nileane/TangerineUI-for-Mastodon synced 2024-11-23 14:46:10 +09:00

Add install and update example scripts

This commit is contained in:
Niléane 2024-10-19 19:49:35 +02:00
parent f42d69db34
commit cdd9e776f9
No known key found for this signature in database
2 changed files with 62 additions and 0 deletions

35
install.sh.example Normal file
View File

@ -0,0 +1,35 @@
#!/bin/bash
# Ensure the script exits if any command fails
set -e
# Set the repository and Mastodon paths
TANGERINEUI="/home/mastodon/TangerineUI"
MASTODON="/home/mastodon/live"
# Navigate to the repository
cd "$TANGERINEUI" || { echo "Tangerine UI repository directory not found: $REPO"; exit 1; }
# Pull the latest changes from the repository
git pull || { echo "Failed to pull latest changes from the Tangerine UI repository"; exit 1; }
# Copy styles from the Mastodon repository to the target directory
cp -r "./mastodon/app/javascript/styles/"* "$MASTODON/app/javascript/styles"
# Add Tangerine UI to themes.yml
{
echo "tangerineui: styles/tangerineui.scss"
echo "tangerineui-purple: styles/tangerineui-purple.scss"
echo "tangerineui-cherry: styles/tangerineui-cherry.scss"
echo "tangerineui-lagoon: styles/tangerineui-lagoon.scss"
} >> "$MASTODON/config/themes.yml"
# Navigate to the Mastodon directory
cd "$MASTODON" || { echo "Mastodon directory not found: $MASTODON"; exit 1; }
# Precompile assets in production mode
RAILS_ENV=production bundle exec rails assets:precompile
echo ""
echo "Tangerine UI was successfully installed."
echo "Restart all Mastodon services for the changes to take effect."

27
update.sh.example Normal file
View File

@ -0,0 +1,27 @@
#!/bin/bash
# Ensure the script exits if any command fails
set -e
# Set the repository and Mastodon paths
TANGERINEUI="/home/mastodon/TangerineUI"
MASTODON="/home/mastodon/live"
# Navigate to the repository
cd "$TANGERINEUI" || { echo "Tangerine UI repository directory not found: $REPO"; exit 1; }
# Pull the latest changes from the repository
git pull || { echo "Failed to pull latest changes from the Tangerine UI repository"; exit 1; }
# Copy styles from the Mastodon repository to the target directory
cp -r "./mastodon/app/javascript/styles/"* "$MASTODON/app/javascript/styles"
# Navigate to the Mastodon directory
cd "$MASTODON" || { echo "Mastodon directory not found: $MASTODON"; exit 1; }
# Precompile assets in production mode
RAILS_ENV=production bundle exec rails assets:precompile
echo ""
echo "Tangerine UI was successfully updated."
echo "Restart all Mastodon services for the changes to take effect."