It's tripped me up a few times that version string generation happens in the Vite build.
When someone forks a repo, they don't have the tags, so when they run ./scripts.sh build, the build will fail with a confusing error about git describe.
This adjusts the logic so that we determine the fusion version string in scripts.sh and in the release.yml workflow. It also makes it so that if no version string is available, the frontend defaults to 'unknown-version'.
This should also make it easier for distributions that want to package fusion, as they previously had to apply workarounds to avoid issues related to deriving the version from git:
https://github.com/NixOS/nixpkgs/pull/353616/files#diff-bf194e560f79450a8df2281184c901a7cab6f5da1e25b3b20ec7767e9482ad1e
Docker currently duplicates the build logic from scripts.sh. It's not a big deal now because it's only a couple of standard lines, but if we want to customize the build in the future, it will be useful to have a single, authoritative build script that all build paths use.
The set -e option tells /bin/sh to exit immediately when any command terminates with a failing exit code. Using this option allows us to simplify a lot of the logic and remove the && and || exit 1 clauses because they're not necessary with set -e.