Skip to content

Commit

Permalink
More fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Sep 6, 2024
1 parent de1ef29 commit 0ac16c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions crates/cli/src/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub fn detect_proto_env(cli: &CLI) -> AppResult<ProtoEnvironment> {
#[instrument(skip_all)]
pub fn load_proto_configs(env: &ProtoEnvironment) -> AppResult {
debug!(
working_dir = ?env.cwd,
"Loading configuration in {} mode",
env.config_mode.to_string()
);
Expand Down
10 changes: 7 additions & 3 deletions crates/core/src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,26 @@ impl ProtoEnvironment {

pub fn new_testing(sandbox: &Path) -> miette::Result<Self> {
let mut env = Self::from(sandbox.join(".proto"), sandbox.join(".home"))?;
env.cwd = sandbox.to_path_buf();
env.test_only = true;

Ok(env)
}

pub fn from<R: AsRef<Path>, H: AsRef<Path>>(root: R, home: H) -> miette::Result<Self> {
let root = root.as_ref();
let home = home.as_ref();

debug!(store = ?root, "Creating proto environment, detecting store");
debug!(
store = ?root,
home = ?home,
"Creating proto environment, detecting store",
);

Ok(ProtoEnvironment {
config_mode: ConfigMode::Upwards,
cwd: env::current_dir().expect("Unable to determine current working directory!"),
env_mode: env::var("PROTO_ENV").ok(),
home: home.as_ref().to_owned(),
home: home.to_owned(),
root: root.to_owned(),
config_manager: Arc::new(OnceCell::new()),
plugin_loader: Arc::new(OnceCell::new()),
Expand Down

0 comments on commit 0ac16c2

Please sign in to comment.