@@ -51,7 +51,7 @@ def get_pipx_user_bin_path() -> Optional[Path]:
51
51
return pipx_bin_path
52
52
53
53
54
- def ensure_path (location : Path , * , force : bool , prepend : bool = False ) -> Tuple [bool , bool ]:
54
+ def ensure_path (location : Path , * , force : bool , prepend : bool = False , all_shells : bool = False ) -> Tuple [bool , bool ]:
55
55
"""Ensure location is in user's PATH or add it to PATH.
56
56
If prepend is True, location will be prepended to PATH, else appended.
57
57
Returns True if location was added to PATH
@@ -63,9 +63,9 @@ def ensure_path(location: Path, *, force: bool, prepend: bool = False) -> Tuple[
63
63
64
64
if force or (not in_current_path and not need_shell_restart ):
65
65
if prepend :
66
- path_added = userpath .prepend (location_str , "pipx" )
66
+ path_added = userpath .prepend (location_str , "pipx" , all_shells = all_shells )
67
67
else :
68
- path_added = userpath .append (location_str , "pipx" )
68
+ path_added = userpath .append (location_str , "pipx" , all_shells = all_shells )
69
69
if not path_added :
70
70
print (
71
71
pipx_wrap (
@@ -100,7 +100,7 @@ def ensure_path(location: Path, *, force: bool, prepend: bool = False) -> Tuple[
100
100
return (path_added , need_shell_restart )
101
101
102
102
103
- def ensure_pipx_paths (force : bool , prepend : bool = False ) -> ExitCode :
103
+ def ensure_pipx_paths (force : bool , prepend : bool = False , all_shells : bool = False ) -> ExitCode :
104
104
"""Returns pipx exit code."""
105
105
bin_paths = {paths .ctx .bin_dir }
106
106
@@ -113,7 +113,9 @@ def ensure_pipx_paths(force: bool, prepend: bool = False) -> ExitCode:
113
113
path_action_str = "prepended to" if prepend else "appended to"
114
114
115
115
for bin_path in bin_paths :
116
- (path_added_current , need_shell_restart_current ) = ensure_path (bin_path , prepend = prepend , force = force )
116
+ (path_added_current , need_shell_restart_current ) = ensure_path (
117
+ bin_path , prepend = prepend , force = force , all_shells = all_shells
118
+ )
117
119
path_added |= path_added_current
118
120
need_shell_restart |= need_shell_restart_current
119
121
0 commit comments