1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use cratePathUpdater;
use cratePlatformPathUpdater;
use Path;
pub use PathmanError;
pub use UpdateType;
/// Prepends the given path to the PATH environment variable
///
/// This function provides a cross-platform interface for prepending a given
/// path to the user's PATH environment variable.
///
/// It is generally necessary for the end user to restart their shell or to
/// source their shell configuration file for the changes to take effect.
///
/// # OS-specific behavior
///
/// This function behaves differently depending on the operating system,
/// because the method of modifying the PATH environment variable varies
/// across platforms.
///
/// # macOS and Linux
///
/// On macOS and Linux, PATH is modified by adding a command to the user's
/// shell configuration file (e.g., `.bashrc`, `.zshrc`, etc.).
///
/// # Windows
///
/// On Windows, the user's PATH is modified by updating the registry.
/// Appends the given path to the PATH environment variable
///
/// This function provides a cross-platform interface for appending a given
/// path to the user's PATH environment variable.
///
/// It is generally necessary for the end user to restart their shell or to
/// source their shell configuration file for the changes to take effect.
///
/// # OS-specific behavior
///
/// This function behaves differently depending on the operating system,
/// because the method of modifying the PATH environment variable varies
/// across platforms.
///
/// # macOS and Linux
///
/// On macOS and Linux, PATH is modified by adding a command to the user's
/// shell configuration file (e.g., `.bashrc`, `.zshrc`, etc.).
///
/// # Windows
///
/// On Windows, the user's PATH is modified by updating the registry.