@@ -220,7 +220,7 @@ fn collect_local_hx_manifest(queries_dir: &Path) -> Result<HashMap<String, Manif
220220 continue ;
221221 }
222222
223- let is_hx = path. extension ( ) . map ( |ext| ext == "hx" ) . unwrap_or ( false ) ;
223+ let is_hx = path. extension ( ) . is_some_and ( |ext| ext == "hx" ) ;
224224 if !is_hx {
225225 continue ;
226226 }
@@ -704,6 +704,17 @@ fn pull_remote_snapshot_into_local(
704704
705705 let target_manifest = collect_local_hx_manifest ( target_queries_dir) ?;
706706
707+ fs:: create_dir_all ( target_queries_dir) ?;
708+
709+ for ( relative_path, remote_entry) in remote_manifest {
710+ let destination = safe_join_relative ( target_queries_dir, relative_path) ?;
711+ if let Some ( parent) = destination. parent ( ) {
712+ fs:: create_dir_all ( parent) ?;
713+ }
714+ fs:: write ( & destination, & remote_entry. content )
715+ . map_err ( |e| eyre ! ( "Failed to write {}: {}" , relative_path, e) ) ?;
716+ }
717+
707718 for relative_path in local_manifest. keys ( ) {
708719 let local_path = safe_join_relative ( current_queries_dir, relative_path) ?;
709720 if local_path. exists ( ) {
@@ -725,17 +736,6 @@ fn pull_remote_snapshot_into_local(
725736 }
726737 }
727738
728- fs:: create_dir_all ( target_queries_dir) ?;
729-
730- for ( relative_path, remote_entry) in remote_manifest {
731- let destination = safe_join_relative ( target_queries_dir, relative_path) ?;
732- if let Some ( parent) = destination. parent ( ) {
733- fs:: create_dir_all ( parent) ?;
734- }
735- fs:: write ( & destination, & remote_entry. content )
736- . map_err ( |e| eyre ! ( "Failed to write {}: {}" , relative_path, e) ) ?;
737- }
738-
739739 Ok ( ( ) )
740740}
741741
@@ -1745,17 +1745,14 @@ async fn run_project_sync_flow(project: &ProjectContext, assume_yes: bool) -> Re
17451745 assume_yes,
17461746 )
17471747 . await ?;
1748- if let SyncReconciliationOutcome :: Pulled = sync_outcome {
1749- if project. config . project . queries != selected_queries_relative {
1750- update_project_queries_path_in_helix_toml (
1751- & project. root ,
1752- & selected_queries_relative,
1753- ) ?;
1754- Step :: verbose_substep ( & format ! (
1755- " Updated project queries path to {}" ,
1756- selected_queries_relative. display( )
1757- ) ) ;
1758- }
1748+ if let SyncReconciliationOutcome :: Pulled = sync_outcome
1749+ && project. config . project . queries != selected_queries_relative
1750+ {
1751+ update_project_queries_path_in_helix_toml ( & project. root , & selected_queries_relative) ?;
1752+ Step :: verbose_substep ( & format ! (
1753+ " Updated project queries path to {}" ,
1754+ selected_queries_relative. display( )
1755+ ) ) ;
17591756 }
17601757 }
17611758
@@ -2176,17 +2173,17 @@ async fn pull_from_cloud_instance(
21762173 )
21772174 . await ?;
21782175
2179- if let SyncReconciliationOutcome :: Pulled = sync_outcome {
2180- if project. config . project . queries != selected_queries_relative {
2181- update_project_queries_path_in_helix_toml (
2182- & project . root ,
2183- & selected_queries_relative ,
2184- ) ? ;
2185- Step :: verbose_substep ( & format ! (
2186- " Updated project queries path to {}" ,
2187- selected_queries_relative . display ( )
2188- ) ) ;
2189- }
2176+ if let SyncReconciliationOutcome :: Pulled = sync_outcome
2177+ && project. config . project . queries != selected_queries_relative
2178+ {
2179+ update_project_queries_path_in_helix_toml (
2180+ & project . root ,
2181+ & selected_queries_relative ,
2182+ ) ? ;
2183+ Step :: verbose_substep ( & format ! (
2184+ " Updated project queries path to {}" ,
2185+ selected_queries_relative . display ( )
2186+ ) ) ;
21902187 }
21912188
21922189 reconcile_project_config_from_cloud (
0 commit comments