Skip to content
Snippets Groups Projects
Commit 00bb228a authored by Stefano Rivera's avatar Stefano Rivera
Browse files

New upstream version 1.9.0

parent 6c1f975d
No related branches found
No related tags found
No related merge requests found
......@@ -4,10 +4,17 @@ History
master
^^^^^^
1.9.0
^^^^^
- Ignore the current directory for path detection on Windows
- On non-Windows systems only modify login shells
1.8.0
^^^^^
- Broadcast WM_SETTINGCHANGE on Windows
- zsh: respect ZDOTDIR env var
- Drop Python 2.7 & 3.6
1.7.0
......
......@@ -24,6 +24,7 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
......
from .core import append, in_new_path, need_shell_restart, prepend
from .utils import in_current_path
__version__ = '1.8.0'
__version__ = '1.9.0'
......@@ -30,8 +30,6 @@ class Bash(Shell):
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')
......@@ -44,13 +42,11 @@ class Bash(Shell):
# Terminal.app runs a login shell by default for each new terminal window.
login_config = bash_profile_path
configs[login_config] = contents
return configs
return {login_config: contents}
@classmethod
def show_path_commands(cls):
return [['bash', '-i', '-c', 'echo $PATH'], ['bash', '-i', '-l', '-c', 'echo $PATH']]
return [['bash', '-i', '-l', '-c', 'echo $PATH']]
class Fish(Shell):
......@@ -95,11 +91,12 @@ class Zsh(Shell):
contents = 'export PATH="{}"'.format(new_path)
zdotdir = environ.get('ZDOTDIR', self.home)
return {path.join(zdotdir, '.zshrc'): contents, path.join(zdotdir, '.zprofile'): contents}
return {path.join(zdotdir, '.zprofile'): contents}
@classmethod
def show_path_commands(cls):
return [['zsh', '-i', '-c', 'echo $PATH'], ['zsh', '-i', '-l', '-c', 'echo $PATH']]
return [['zsh', '-i', '-l', '-c', 'echo $PATH']]
SHELLS = {
......
......@@ -16,7 +16,7 @@ def normpath(location):
def location_in_path(location, path):
return normpath(location) in (normpath(p) for p in path.split(os.pathsep))
return normpath(location) in (normpath(p) for p in path.split(os.pathsep) if p != '')
def in_current_path(location):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment