Repository navigation
fix(install): remove legacy sam references and deduplicate install.sh - #726
Conversation
There was a problem hiding this comment.
Code Review
This pull request moves the installation script to site/static/install.sh, replaces the root install.sh with a symlink, removes legacy sam-* binary references, and introduces configurable installation directories. Feedback highlights that using a Git symlink for the root install.sh will break the common curl | bash installation method via GitHub raw URLs. Additionally, using the generic INSTALL_DIR environment variable poses a collision risk, and it is recommended to only support the prefixed AGENTMESH_INSTALL_DIR variable.
I am having trouble creating individual review comments. Click here to see my feedback.
install.sh (1)
Using a Git symlink for the top-level install.sh will break the common curl -fsSL https://raw.githubusercontent.com/.../install.sh | bash installation method. When fetching a symlink via GitHub's raw URL, GitHub returns the literal target path string (site/static/install.sh) rather than the contents of the target file. Consequently, running the curl command will attempt to execute the string site/static/install.sh as a command, resulting in a No such file or directory error on the user's machine.
Instead of a symlink, consider keeping install.sh at the root as the source of truth, and copy it to site/static/install.sh during the website build/deployment process, or use a pre-commit hook / Makefile target to keep them in sync.
site/static/install.sh (5)
Using the highly generic environment variable INSTALL_DIR to override the installation directory is risky. If a user has INSTALL_DIR set in their environment for another tool or build process, this script will silently install Agent Mesh into that directory instead of /usr/local/bin.
It is safer to only support the prefixed AGENTMESH_INSTALL_DIR environment variable to avoid accidental collisions.
INSTALL_DIR="${AGENTMESH_INSTALL_DIR:-/usr/local/bin}"
sam_${OS_NAME}_${ARCH_NAME}.tar.gzfallback andsam-*binary names fromsite/static/install.sh.INSTALL_DIRviaAGENTMESH_INSTALL_DIRorINSTALL_DIRenvironment variables.install.shwith a symlink tosite/static/install.shso the script is maintained in one place while Hugo continues serving a regular file at/install.sh.