File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1022,7 +1022,7 @@ fn update_manifest_with_new_member(
10221022 }
10231023 }
10241024 }
1025- } else {
1025+ } else if workspace_document . contains_key ( "workspace" ) {
10261026 let ws = workspace_document[ "workspace" ]
10271027 . as_table_mut ( )
10281028 . with_context ( || format ! ( "[workspace] is not a table" ) ) ?;
@@ -1050,6 +1050,11 @@ fn update_manifest_with_new_member(
10501050 }
10511051
10521052 ws. insert ( "members" , toml_edit:: value ( array) ) ;
1053+ } else {
1054+ let mut array = Array :: new ( ) ;
1055+ array. push ( relpath) ;
1056+ array. decor_mut ( ) . set_suffix ( "\n " ) ;
1057+ workspace_document[ "workspace" ] [ "members" ] = toml_edit:: value ( array) ;
10531058 }
10541059
10551060 paths:: write ( & root_manifest_path, workspace_document. to_string ( ) )
You can’t perform that action at this time.
0 commit comments