@@ -45,9 +45,9 @@ impl Env {
4545 ///
4646 /// This means we work on any operating system, as long as you can invoke the Supervisor,
4747 /// without having to worry much about context.
48- pub async fn new ( package : & PackageInstall ) -> Result < Self > {
48+ pub async fn new ( package : & PackageInstall , token : Option < & str > ) -> Result < Self > {
4949 let mut env = package. environment_for_command ( ) ?;
50- let path = Self :: transform_path ( env. get ( PATH_KEY ) , package. package_type ( ) ?) . await ?;
50+ let path = Self :: transform_path ( env. get ( PATH_KEY ) , package. package_type ( ) ?, token ) . await ?;
5151 env. insert ( PATH_KEY . to_string ( ) , path) ;
5252 Ok ( Env ( env) )
5353 }
@@ -60,13 +60,16 @@ impl Env {
6060 self . 0 . insert ( key, value) ;
6161 }
6262
63- async fn transform_path ( path : Option < & String > , package_type : PackageType ) -> Result < String > {
63+ async fn transform_path ( path : Option < & String > ,
64+ package_type : PackageType ,
65+ token : Option < & str > )
66+ -> Result < String > {
6467 let mut paths: Vec < PathBuf > = match path {
6568 Some ( path) => env:: split_paths ( & path) . collect ( ) ,
6669 None => vec ! [ ] ,
6770 } ;
6871 match package_type {
69- PackageType :: Standard => path:: append_interpreter_and_env_path ( & mut paths) . await ,
72+ PackageType :: Standard => path:: append_interpreter_and_env_path ( & mut paths, token ) . await ,
7073 PackageType :: Native => path:: append_env_path ( & mut paths) ,
7174 }
7275 }
@@ -101,7 +104,7 @@ pub struct Pkg {
101104}
102105
103106impl Pkg {
104- pub async fn from_install ( package : & PackageInstall ) -> Result < Self > {
107+ pub async fn from_install ( package : & PackageInstall , token : Option < & str > ) -> Result < Self > {
105108 let ident = FullyQualifiedPackageIdent :: try_from ( & package. ident ) ?;
106109 let ( svc_user, svc_group) = get_user_and_group ( package) ?;
107110 let pkg = Pkg { svc_path : fs:: svc_path ( & package. ident . name ) ,
@@ -116,7 +119,7 @@ impl Pkg {
116119 svc_pid_file : fs:: svc_pid_file ( & package. ident . name ) ,
117120 svc_user,
118121 svc_group,
119- env : Env :: new ( package) . await ?,
122+ env : Env :: new ( package, token ) . await ?,
120123 deps : package. tdeps ( ) ?,
121124 exposes : package. exposes ( ) ?,
122125 exports : package. exports ( ) ?,
0 commit comments