Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix adding duplicate paths to PATH during installation #5108

Merged
merged 2 commits into from
May 16, 2024
Merged

Fix adding duplicate paths to PATH during installation #5108

merged 2 commits into from
May 16, 2024

Conversation

wanzzhehe
Copy link
Contributor

修复可能导致PATH重复添加的问题。

@wanzzhehe wanzzhehe changed the title [BUG FIX] 修正PATH重复添加的问题。 Fix adding duplicate paths to PATH during installation May 15, 2024
@waruqi
Copy link
Member

waruqi commented May 15, 2024

重复添加会有什么问题?

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


What are the problems with repeated additions?

@wanzzhehe
Copy link
Contributor Author

主要是:

  1. 减少对环境变量的改动
  2. 可能与某些自定义脚本冲突
  3. 难看,并且其它软件也这么搞的话PATH会更难看而且过长。

重点解释下2,由于xmake安装脚本会自动修改.bashrc等配置文件,并将修改放在文件最末尾,重复添加PATH就可能导致一些重名工具使用时使用了错误的工具。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


mainly:

  1. Reduce changes to environment variables
  2. May conflict with some custom scripts
  3. It is ugly, and if other software does this, PATH will be even more ugly and too long.

Focus on explanation 2. Since the xmake installation script will automatically modify configuration files such as .bashrc and place the modifications at the end of the file, repeatedly adding PATH may cause some tools with the same name to use the wrong tool.

@waruqi
Copy link
Member

waruqi commented May 16, 2024

@wanzzhehe
Copy link
Contributor Author

我的锅,倒是其他是怎么成功的(

应该用逻辑或的。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


My fault, but how others succeeded (

Logical OR should be used.

@waruqi waruqi merged commit fdb3168 into xmake-io:dev May 16, 2024
19 checks passed
@waruqi
Copy link
Member

waruqi commented May 16, 2024

thanks

@waruqi waruqi added this to the v2.9.2 milestone May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants