Skip to content

Avoid adding modified PATH to multiple shell config files #46

@chrysle

Description

@chrysle

userpath.append() seems to write the modified PATH to all available shell configuration files currently. Example:

$ mkdir temp/ && userpath append -s bash temp/
$ tail -n 2 .bashrc && tail -n 2 .profile 
# Created by `userpath` on 2023-06-18 13:18:55
export PATH="$PATH:/home/user/temp"
# Created by `userpath` on 2023-06-18 13:18:55
export PATH="$PATH:/home/user/temp"

I'd think there should be an option to turn that off. Or is there?

This code seems to be responsible for the behaviour:

for shell in self.shells:
for file, contents in shell.config(location, front=front).items():

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions