⎗ ✓ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88#!/bin/bash set -e # Exit on error set -o pipefail # Catch pipeline failures # Define the installation directory INSTALL_DIR="$HOME/gfStory-en" echo "==> Cloning repository into $INSTALL_DIR..." if [ -d "$INSTALL_DIR" ]; then echo "==> Directory already exists, pulling latest changes..." cd "$INSTALL_DIR" git pull --recurse-submodules else git clone --recurse-submodules https://github.com/shiropantsu/gfStory-en "$INSTALL_DIR" cd "$INSTALL_DIR" fi echo "==> Updating package lists..." sudo apt update echo "==> Installing dependencies..." sudo apt install -y ffmpeg pngquant imagemagick libfuse2 wget unzip curl git echo "==> Installing vgmstream and ImageMagick CLI..." mkdir -p "$INSTALL_DIR/bin" cd "$INSTALL_DIR/bin" wget -q https://github.com/vgmstream/vgmstream-releases/releases/download/nightly/vgmstream-linux-cli.tar.gz tar -zxf vgmstream-linux-cli.tar.gz && rm vgmstream-linux-cli.tar.gz wget -q https://imagemagick.org/archive/binaries/magick chmod +x magick vgmstream-cli export PATH="$INSTALL_DIR/bin:$PATH" echo "==> Installing PDM (Python dependency manager)..." curl -sSL https://pdm.fming.dev/install-pdm.py | python3 - export PATH="$HOME/.local/bin:$PATH" echo "==> Setting up Python environment..." cd "$INSTALL_DIR/unpack" pdm install source .venv/bin/activate pip install -r downloader/requirements.txt echo "==> Downloading resources..." mkdir -p downloader/resdata cp gf-data-us/resdata_no_hash.json downloader/resdata/us_resdata.json cd downloader sed -i 's/"ch"/"us"/' config.json5 git apply ../downloader.patch zip -j resdata.zip resdata/us_resdata.json python downloader.py --downloadres 0 --abname echo "==> Unpacking and processing resources..." cd "$INSTALL_DIR/unpack" python tests/test_backgrounds.py python tests/test_characters.py python tests/test_audio.py python -m gfunpack downloader/output -o . echo "==> Moving resources..." cp audio/audio.json images/backgrounds.json images/characters.json stories/stories.json stories/chapters.json ../src/assets mv audio ../public mv images ../public mv stories ../public echo "==> Installing FNM (Fast Node Manager)..." curl -fsSL https://fnm.vercel.app/install | bash export PATH="$HOME/.fnm:$PATH" eval "$(fnm env)" echo "==> Installing latest Node.js version using FNM..." fnm install --lts fnm use --lts export PATH="$(fnm bin):$PATH" echo "==> Installing PNPM..." curl -fsSL https://get.pnpm.io/install.sh | sh - export PATH="$HOME/.local/share/pnpm:$PATH" echo "==> Installing and building site..." cd "$INSTALL_DIR" pnpm install pnpm build-index pnpm build echo "==> Setup complete! You can now run the project locally."