Skip to content

[BUG]: The new PATH values will be lost when the Hook function is executed. #144

Closed

Description

@aooohan

我想起在使用过程中遇到一个问题,我在vfox挂载指令后面继续设置PATH。

eval "$(vfox activate bash)"
export PATH=$HOME/bin:$PATH

结果就是vfox切换版本读取__VFOX_ORIG_PATH环境变量是我设置PATH之前的值,这时$HOME/bin在PATH环境变量中被丢掉了。

如果将方案改为最开始设置临时目录,然后使用软连接切换版本就不会出现这种问题。

目前我不得不将eval "$(vfox activate bash)"放到最后设置PATH指令后面执行。

Originally posted by @jan-bar in #141 (comment)

Activity

  1. changed the title [-]The new PATH values will be lost when the Hook function is executed.[/-] [+][BUG]: The new PATH values will be lost when the Hook function is executed.[/+] on Mar 25, 2024
  2. self-assigned this
    on Mar 25, 2024
  3. jan-bar commented on Mar 25, 2024

    @jan-bar
    Contributor

    如果真要修改为软连接版本,建议创建软连接使用 os.Symlink 这个方案。

    原因可以看看 voidint/g#51 ,我看新出的vm版本管理也没解决这个问题 version-manager

  4. aooohan commented on Mar 25, 2024

    @aooohan
    MemberAuthor

    如果真要修改为软连接版本,建议创建软连接使用 os.Symlink 这个方案。

    不改成软连接方案. 还是现有方案, 能解决哈哈哈.

    原因可以看看 voidint/g#51 ,我看新出的vm版本管理也没解决这个问题 version-manager

    哈哈哈哈, 这就出来对手了? 哈哈哈哈

  5. jan-bar commented on Mar 25, 2024

    @jan-bar
    Contributor

    是的,readme里面拿vfox做比较啊,哈哈。不过我比较喜欢软连接,路径可以短点,go会编译路径到可执行程序,所以也不想路径携带太多信息额。不过我还是更喜欢vfox的lua脚本插件机制,更加灵活。

  6. aooohan commented on Mar 25, 2024

    @aooohan
    MemberAuthor

    是的,readme里面拿vfox做比较啊,哈哈。不过我比较喜欢软连接,路径可以短点,go会编译路径到可执行程序,所以也不想路径携带太多信息额。不过我还是更喜欢vfox的lua脚本插件机制,更加灵活。

    这项目刚4个月. 还有很多需要优化的. 一点一点来吧.

    有好的想法💡, 欢迎继续反馈! 当然, 有兴趣也可以参与进来! 😄

  7. added
    bug
    on Mar 25, 2024
  8. added this to the milestone on Mar 25, 2024
  9. modified the milestones: , 0.3.0 on Mar 26, 2024
  10. added a commit that references this issue on Mar 26, 2024
    8777ec7
  11. added 2 commits that reference this issue on Mar 26, 2024
    038dd9b
    ef9587d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions