File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33#[ cfg( feature = "sys-runtime" ) ]
44pub mod sys_runtime;
55pub mod dir_provider;
6- pub mod dirs;
76pub mod format;
87pub mod fs;
98pub mod git;
109pub mod process;
1110pub mod python;
1211pub mod string;
1312pub mod time;
14-
15- pub use dir_provider:: DirProvider ;
Original file line number Diff line number Diff line change 11//! File-backed credential store at `~/.config/hm/credentials.toml`.
22//!
33//! The file is written with [`Privacy::Private`] (0o600, parent dir 0o700)
4- //! via [`hm_common::fs::blocking:: write_atomic`], keyed by `(service, account)`.
4+ //! via [`hm_common::fs::write_atomic`], keyed by `(service, account)`.
55
66use anyhow:: { Context , Result } ;
77use serde:: { Deserialize , Serialize } ;
@@ -15,7 +15,7 @@ struct CredentialFile {
1515}
1616
1717fn path ( ) -> Result < PathBuf > {
18- let dirs = hm_common:: DirProvider :: new ( ) . context ( "could not determine config directory" ) ?;
18+ let dirs = hm_common:: dir_provider :: DirProvider :: new ( ) . context ( "could not determine config directory" ) ?;
1919 Ok ( dirs. config ( ) . join ( "hm" ) . join ( "credentials.toml" ) )
2020}
2121
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ impl Config {
119119 ///
120120 /// Returns an error if the platform config directory cannot be determined.
121121 pub fn user_config_path ( ) -> Result < PathBuf > {
122- let dirs = hm_common:: DirProvider :: new ( ) . context ( "could not determine config directory" ) ?;
122+ let dirs = hm_common:: dir_provider :: DirProvider :: new ( ) . context ( "could not determine config directory" ) ?;
123123 Ok ( dirs. config ( ) . join ( "hm" ) . join ( "config.toml" ) )
124124 }
125125
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ impl LocalBackend {
5050 /// (VM backend + snapshot registry) and registering the [`VmRunner`] as
5151 /// the default runner.
5252 fn build_registry ( & self ) -> Result < RunnerRegistry > {
53- let dirs = hm_common:: DirProvider :: new ( ) . ok_or_else ( || {
53+ let dirs = hm_common:: dir_provider :: DirProvider :: new ( ) . ok_or_else ( || {
5454 BackendError :: Local ( "cannot resolve the Harmont cache directory" . into ( ) )
5555 } ) ?;
5656 let registry =
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ impl RunContext {
2828 /// Returns an error if the config file is unreadable or malformed.
2929 pub fn from_cli ( cli : & Cli ) -> Result < Self > {
3030 let start_dir = std:: env:: current_dir ( ) . context ( "cannot determine current directory" ) ?;
31- let project_root = hm_common :: dirs :: find_project_root ( & start_dir) ;
31+ let project_root = crate :: project :: find_project_root ( & start_dir) ;
3232 let config = Config :: load ( project_root. as_deref ( ) ) ?;
3333
3434 let output = OutputMode :: Human {
Original file line number Diff line number Diff line change 33 reason = "transitive dependency version conflicts in rand/windows-sys/thiserror chains; not fixable without upstream updates"
44) ]
55// The `dirs` crate must NOT be added as a direct dependency of this
6- // crate. All directory resolution goes through `hm_common::dirs`, which
7- // owns the `dirs` dependency and provides both platform primitives and
8- // Harmont-specific discovery. Adding `dirs` here would bypass that
9- // single source of truth.
6+ // crate. Platform-directory resolution goes through
7+ // `hm_common::DirProvider`, which owns the `dirs` dependency. Adding
8+ // `dirs` here would bypass that single source of truth.
109
1110#[ allow(
1211 clippy:: print_stdout,
@@ -24,5 +23,6 @@ pub use hm_config as config;
2423/// `harmont_cli::creds_store` path.
2524pub use hm_config:: creds as creds_store;
2625pub mod context;
26+ pub mod project;
2727pub mod error;
2828pub ( crate ) mod signal;
Original file line number Diff line number Diff line change 1- //! Project-directory discovery .
1+ //! The current Harmont project on disk .
22//!
3- //! The `hm`-namespaced directory *roots* (config, cache, …) live in
4- //! [`crate::dir_provider`]. This module handles the orthogonal problem of
5- //! locating the current project by walking up from a starting path.
3+ //! A project is any directory tree rooted at a directory that contains `.hm/`;
4+ //! this module locates that root.
65
76#![ allow( clippy:: must_use_candidate) ]
87
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ fn load_resolves_project_root() {
8585 )
8686 . unwrap ( ) ;
8787
88- let found = hm_common :: dirs :: find_project_root ( project_dir. path ( ) ) ;
88+ let found = harmont_cli :: project :: find_project_root ( project_dir. path ( ) ) ;
8989 assert_eq ! ( found, Some ( project_dir. path( ) . to_path_buf( ) ) ) ;
9090
9191 let config_path = harmont_cli:: config:: Config :: project_config_path ( project_dir. path ( ) ) ;
You can’t perform that action at this time.
0 commit comments