File tree Expand file tree Collapse file tree 2 files changed +322
-19
lines changed
Expand file tree Collapse file tree 2 files changed +322
-19
lines changed Original file line number Diff line number Diff line change 22// Licensed under the MIT License.
33
44use pet_core:: os_environment:: Environment ;
5+ use std:: path:: PathBuf ;
56
67#[ derive( Debug , Clone ) ]
78// NOTE: Do not implement Default trait, as we do not want to ever forget to set the values.
@@ -10,6 +11,9 @@ pub struct EnvVariables {
1011 #[ allow( dead_code) ]
1112 pub pipenv_max_depth : u16 ,
1213 pub pipenv_pipfile : String ,
14+ pub home : Option < PathBuf > ,
15+ pub xdg_data_home : Option < String > ,
16+ pub workon_home : Option < PathBuf > ,
1317}
1418
1519impl EnvVariables {
@@ -22,6 +26,11 @@ impl EnvVariables {
2226 pipenv_pipfile : env
2327 . get_env_var ( "PIPENV_PIPFILE" . to_string ( ) )
2428 . unwrap_or ( "Pipfile" . to_string ( ) ) ,
29+ home : env. get_user_home ( ) ,
30+ xdg_data_home : env. get_env_var ( "XDG_DATA_HOME" . to_string ( ) ) ,
31+ workon_home : env
32+ . get_env_var ( "WORKON_HOME" . to_string ( ) )
33+ . map ( PathBuf :: from) ,
2534 }
2635 }
2736}
You can’t perform that action at this time.
0 commit comments