@@ -51,7 +51,7 @@ def get_pipx_user_bin_path() -> Optional[Path]:
5151 return pipx_bin_path
5252
5353
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 ]:
5555 """Ensure location is in user's PATH or add it to PATH.
5656 If prepend is True, location will be prepended to PATH, else appended.
5757 Returns True if location was added to PATH
@@ -63,9 +63,9 @@ def ensure_path(location: Path, *, force: bool, prepend: bool = False) -> Tuple[
6363
6464 if force or (not in_current_path and not need_shell_restart ):
6565 if prepend :
66- path_added = userpath .prepend (location_str , "pipx" )
66+ path_added = userpath .prepend (location_str , "pipx" , all_shells = all_shells )
6767 else :
68- path_added = userpath .append (location_str , "pipx" )
68+ path_added = userpath .append (location_str , "pipx" , all_shells = all_shells )
6969 if not path_added :
7070 print (
7171 pipx_wrap (
@@ -100,7 +100,7 @@ def ensure_path(location: Path, *, force: bool, prepend: bool = False) -> Tuple[
100100 return (path_added , need_shell_restart )
101101
102102
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 :
104104 """Returns pipx exit code."""
105105 bin_paths = {paths .ctx .bin_dir }
106106
@@ -113,7 +113,9 @@ def ensure_pipx_paths(force: bool, prepend: bool = False) -> ExitCode:
113113 path_action_str = "prepended to" if prepend else "appended to"
114114
115115 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+ )
117119 path_added |= path_added_current
118120 need_shell_restart |= need_shell_restart_current
119121
0 commit comments