File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,12 +99,17 @@ impl PlugCommand {
9999 let mut graph = CompositionGraph :: new ( ) ;
100100
101101 #[ cfg( feature = "registry" ) ]
102- let client = FileSystemClient :: new_with_default_config ( self . registry . as_deref ( ) ) . ok ( ) ;
102+ let mut client = None ;
103103
104104 let socket_path = match & self . socket {
105105 #[ cfg( feature = "registry" ) ]
106106 PackageRef :: RegistryPackage ( ( name, version) ) => {
107- let client = client. as_ref ( ) . ok_or_else ( || {
107+ if client. is_none ( ) {
108+ client = Some ( FileSystemClient :: new_with_default_config (
109+ self . registry . as_deref ( ) ,
110+ ) ) ;
111+ }
112+ let client = client. as_ref ( ) . unwrap ( ) . as_ref ( ) . map_err ( |_| {
108113 anyhow:: anyhow!(
109114 "Warg registry is not configured. Package `{name}` was not found."
110115 )
@@ -170,7 +175,12 @@ impl PlugCommand {
170175 let ( mut name, path) = match plug_ref {
171176 #[ cfg( feature = "registry" ) ]
172177 PackageRef :: RegistryPackage ( ( name, version) ) => {
173- let client = client. as_ref ( ) . ok_or_else ( || {
178+ if client. is_none ( ) {
179+ client = Some ( FileSystemClient :: new_with_default_config (
180+ self . registry . as_deref ( ) ,
181+ ) ) ;
182+ }
183+ let client = client. as_ref ( ) . unwrap ( ) . as_ref ( ) . map_err ( |_| {
174184 anyhow:: anyhow!(
175185 "Warg registry is not configured. Package `{name}` was not found."
176186 )
You can’t perform that action at this time.
0 commit comments