feat(Makefile): add install target with existing-version guard#5379
Open
Josh-Jing wants to merge 1 commit into
Open
feat(Makefile): add install target with existing-version guard#5379Josh-Jing wants to merge 1 commit into
Josh-Jing wants to merge 1 commit into
Conversation
Add a make install target that builds and installs the binary to $(PREFIX)/bin (default ~/.local/bin). If a previous installation is detected, the target errors out with a message prompting the user to run "make install FORCE=1" to overwrite — preventing silent overwrites. Also document the new target in README.md and README.zh-CN.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does | 这个 PR 做了什么
English:
This PR adds a proper
make installtarget that automates from-source installation:reasonix+reasonix-plugin-example)$(PREFIX)/bin(defaults to~/.local/bin)make install FORCE=1to overwrite.Why this helps:
cpbinaries to PATH, which could be error-prone and left users wondering if all components were installed correctly.npm i -g reasonix, I got a 0.x (legacy TypeScript) version instead of 1.x (Go). The configuration didn't work, and I had to manually copy the built binaries to PATH - which made me wonder if I had all required components installed properly. This PR solves that experience gap.Updated both
README.mdandREADME.zh-CN.mdto document the new target.中文说明:
本 PR 添加了完整的
make install目标,自动化从源码安装流程:reasonix+reasonix-plugin-example)$(PREFIX)/bin(默认~/.local/bin)make install FORCE=1才允许覆盖。解决的问题:
cp二进制到 PATH,容易出错,而且会担心是不是漏装了组件。现在一条命令搞定,安装路径清晰易管理。npm i -g reasonix,结果装完是 0.x TypeScript 旧版本,按照文档配置后完全不生效。排查之后不得不从源码构建再手动复制到 PATH,但过程中一直怀疑是不是漏装了某个组件。这个 PR 填补了这个体验缺口。同时更新了英文和简体中文 README 文档。
Testing | 测试
make install全新安装正常工作make install在已有安装时报错提示make install FORCE=1成功覆盖安装reasonix和reasonix-plugin-example两个二进制