File tree Expand file tree Collapse file tree
pixi_api/src/workspace/registry Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ impl Default for WorkspaceRegistry {
3333
3434impl WorkspaceRegistry {
3535 /// Loads the workspace registry from disk, if it exists.
36- pub async fn load ( ) -> miette:: Result < Self > {
36+ pub fn load ( ) -> miette:: Result < Self > {
3737 let path = workspace_registry_path ( )
3838 . ok_or_else ( || miette:: miette!( "Unable to determine pixi home directory" ) ) ?;
3939
Original file line number Diff line number Diff line change @@ -5,8 +5,9 @@ use indexmap::IndexSet;
55use itertools:: Itertools ;
66use miette:: IntoDiagnostic ;
77use pep508_rs:: Requirement ;
8+ use pixi_api:: workspace:: WorkspaceRegistry ;
89use pixi_build_frontend:: BackendOverride ;
9- use pixi_config:: { Config , pixi_home } ;
10+ use pixi_config:: Config ;
1011use pixi_consts:: consts;
1112use pixi_core:: DependencyType ;
1213use pixi_core:: Workspace ;
@@ -47,11 +48,9 @@ impl WorkspaceConfig {
4748 if let Some ( manifest_path) = & self . manifest_path {
4849 DiscoveryStart :: ExplicitManifest ( manifest_path. clone ( ) )
4950 } else if let Some ( workspace) = & self . workspace {
50- let path = pixi_home ( )
51- . expect ( "Unable to pixi home" )
52- . join ( consts:: DEFAULT_GLOBAL_WORKSPACE_DIR )
53- . join ( workspace) ;
54- DiscoveryStart :: ExplicitManifest ( path. clone ( ) )
51+ let workspace_registry = WorkspaceRegistry :: load ( ) . expect ( "Unable to load workspace registry" ) ;
52+ let path = workspace_registry. named_workspace ( & workspace) . expect ( "Unable to find workspace" ) ;
53+ DiscoveryStart :: ExplicitManifest ( path)
5554 } else {
5655 DiscoveryStart :: CurrentDir
5756 }
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ pub enum Command {
6060pub async fn execute ( args : Args ) -> miette:: Result < ( ) > {
6161 match args. command {
6262 Some ( Command :: List ( args) ) => {
63- let workspace_registry = WorkspaceRegistry :: load ( ) . await ?;
63+ let workspace_registry = WorkspaceRegistry :: load ( ) ?;
6464 let workspaces = workspace_registry. named_workspaces_map ( ) ;
6565 let out = if args. json {
6666 serde_json:: to_string_pretty ( & workspaces) . into_diagnostic ( ) ?
@@ -77,7 +77,7 @@ pub async fn execute(args: Args) -> miette::Result<()> {
7777 . into_diagnostic ( ) ?;
7878 }
7979 Some ( Command :: Remove ( remove_args) ) => {
80- let mut workspace_registry = WorkspaceRegistry :: load ( ) . await ?;
80+ let mut workspace_registry = WorkspaceRegistry :: load ( ) ?;
8181 workspace_registry. remove_workspace ( & remove_args. name ) . await ?;
8282
8383 eprintln ! (
@@ -115,7 +115,7 @@ pub async fn execute(args: Args) -> miette::Result<()> {
115115 . unwrap_or_else ( || workspace. display_name ( ) . to_string ( ) ) ;
116116 let target_path = args. path . unwrap_or_else ( || workspace. root ( ) . to_path_buf ( ) ) ;
117117
118- let mut workspace_registry = WorkspaceRegistry :: load ( ) . await ?;
118+ let mut workspace_registry = WorkspaceRegistry :: load ( ) ?;
119119 workspace_registry. add_workspace ( target_name, target_path) . await ?;
120120
121121 eprintln ! (
You can’t perform that action at this time.
0 commit comments