Skip to content

Commit

Permalink
Revert "Only add modified PATH to login files in login shells (#48)"
Browse files Browse the repository at this point in the history
This reverts commit abfb4bc.
  • Loading branch information
ofek committed Sep 7, 2023
1 parent e0f4282 commit a4c7c71
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ History
master
^^^^^^

- Temporarily revert the change on non-Windows systems where only login shells are modified

1.9.0
^^^^^

Expand Down
13 changes: 8 additions & 5 deletions userpath/shells.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def config(self, location, front=True):
new_path = '{}{}{}'.format(head, pathsep, tail)
contents = 'export PATH="{}"'.format(new_path)

configs = {path.join(self.home, '.bashrc'): contents}

# https://github.com/ofek/userpath/issues/3#issuecomment-492491977
profile_path = path.join(self.home, '.profile')
bash_profile_path = path.join(self.home, '.bash_profile')
Expand All @@ -42,11 +44,13 @@ def config(self, location, front=True):
# Terminal.app runs a login shell by default for each new terminal window.
login_config = bash_profile_path

return {login_config: contents}
configs[login_config] = contents

return configs

@classmethod
def show_path_commands(cls):
return [['bash', '-i', '-l', '-c', 'echo $PATH']]
return [['bash', '-i', '-c', 'echo $PATH'], ['bash', '-i', '-l', '-c', 'echo $PATH']]


class Fish(Shell):
Expand Down Expand Up @@ -91,12 +95,11 @@ def config(self, location, front=True):
contents = 'export PATH="{}"'.format(new_path)

zdotdir = environ.get('ZDOTDIR', self.home)

return {path.join(zdotdir, '.zprofile'): contents}
return {path.join(zdotdir, '.zshrc'): contents, path.join(zdotdir, '.zprofile'): contents}

@classmethod
def show_path_commands(cls):
return [['zsh', '-i', '-l', '-c', 'echo $PATH']]
return [['zsh', '-i', '-c', 'echo $PATH'], ['zsh', '-i', '-l', '-c', 'echo $PATH']]


SHELLS = {
Expand Down

0 comments on commit a4c7c71

Please sign in to comment.