2025-09-03 22:12:58 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
# scripts/sync-files.sh - Copy furt source files to installation directory
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
# Check if we're in a furt source directory
|
|
|
|
|
if [ ! -f "src/main.lua" ]; then
|
|
|
|
|
echo "Error: Not in furt source directory (src/main.lua not found)"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Target directory
|
|
|
|
|
TARGET="/usr/local/share/furt"
|
|
|
|
|
|
|
|
|
|
echo "Copying furt files to $TARGET..."
|
|
|
|
|
|
|
|
|
|
# Copy main directories
|
|
|
|
|
cp -r src/ "$TARGET/"
|
|
|
|
|
cp -r config/ "$TARGET/"
|
|
|
|
|
cp -r scripts/ "$TARGET/"
|
|
|
|
|
cp -r integrations/ "$TARGET/"
|
|
|
|
|
|
|
|
|
|
# Copy version files for merkwerk integration
|
|
|
|
|
[ -f "VERSION" ] && cp VERSION "$TARGET/"
|
|
|
|
|
[ -f ".version_history" ] && cp .version_history "$TARGET/"
|
|
|
|
|
|
2025-09-10 12:20:41 +02:00
|
|
|
# Set proper permissions based on operating system
|
|
|
|
|
if [ "$(uname)" = "OpenBSD" ]; then
|
|
|
|
|
chown -R root:wheel "$TARGET"
|
|
|
|
|
else
|
|
|
|
|
chown -R root:root "$TARGET"
|
|
|
|
|
fi
|
|
|
|
|
|
2025-09-03 22:12:58 +02:00
|
|
|
chmod -R 644 "$TARGET"
|
|
|
|
|
find "$TARGET" -type d -exec chmod 755 {} \;
|
|
|
|
|
chmod +x "$TARGET/scripts/start.sh"
|
|
|
|
|
|
|
|
|
|
echo "Files synced successfully to $TARGET"
|
|
|
|
|
|