From e07cf030b242a5cde3208810cb5a121b7f4ae481 Mon Sep 17 00:00:00 2001 From: Gabber235 Date: Mon, 9 Jun 2025 10:50:03 +0200 Subject: [PATCH] Improve Flutter setup script --- app/AGENTS.md | 12 ++++++++++++ app/install_flutter_linux.sh | 26 ++++++++++++++++++++++++++ documentation/AGENTS.md | 8 ++++++++ 3 files changed, 46 insertions(+) create mode 100755 app/install_flutter_linux.sh diff --git a/app/AGENTS.md b/app/AGENTS.md index c43d877843..025c006030 100644 --- a/app/AGENTS.md +++ b/app/AGENTS.md @@ -2,6 +2,18 @@ The Flutter application provides a web interface for managing Typewriter projects. +## Environment Setup + +On Linux install Flutter once by running: + +```bash +./install_flutter_linux.sh +``` + +Run this script before executing any Flutter commands. +It adds `~/development/flutter/bin` to your `PATH`, so open a new shell or run +`source ~/.bashrc` after installation. + ## Validate Changes Install dependencies and build the web app: diff --git a/app/install_flutter_linux.sh b/app/install_flutter_linux.sh new file mode 100755 index 0000000000..bd08112979 --- /dev/null +++ b/app/install_flutter_linux.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Install Flutter for Linux +FLUTTER_VERSION="${FLUTTER_VERSION:-3.33.0-0.2.pre-beta}" +ARCHIVE="flutter_linux_${FLUTTER_VERSION}.tar.xz" + +mkdir -p ~/development +cd ~/development + +sudo apt-get update -y && sudo apt-get upgrade -y +sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa + +if [ ! -f "$ARCHIVE" ]; then + wget "https://storage.googleapis.com/flutter_infra_release/releases/beta/linux/${ARCHIVE}" +fi + +tar xf "$ARCHIVE" + +sudo chmod 777 -R ~/development +git config --global --add safe.directory ~/development/flutter + +export PATH="$PATH:$(pwd)/flutter/bin" +grep -qxF 'export PATH="$HOME/development/flutter/bin:$PATH"' ~/.bashrc || echo 'export PATH="$HOME/development/flutter/bin:$PATH"' >> ~/.bashrc + +echo "Flutter installed. Restart your shell or run 'source ~/.bashrc' to use it." diff --git a/documentation/AGENTS.md b/documentation/AGENTS.md index 08497c435b..8f8f51044c 100644 --- a/documentation/AGENTS.md +++ b/documentation/AGENTS.md @@ -2,6 +2,14 @@ This folder contains the Docusaurus website. Documentation and blog posts are written in Markdown/MDX. +## Setup + +Install dependencies once with: + +```bash +npm ci +``` + ## Validate Changes Before committing documentation updates make sure the site builds: