Skip to content

Commit

Permalink
Rename vars
Browse files Browse the repository at this point in the history
  • Loading branch information
tarkah committed Nov 27, 2023
1 parent 6eee6fc commit 1fcd868
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions crates/boulder/src/cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ pub fn handle(command: Command, global: Global) -> Result<(), Error> {

let client = Client::new(config_dir, cache_dir, moss_root)?;

let ephemeral_root = client.cache.join("test-root");
let ephemeral_root = client.cache_dir.join("test-root");
recreate_dir(&ephemeral_root)?;

let repos = client.repositories(&profile)?.clone();

client.block_on(async {
let mut moss_client = moss::Client::new("boulder", &client.moss)
let mut moss_client = moss::Client::new("boulder", &client.moss_dir)
.await?
.explicit_repositories(repos)
.await?
Expand Down
2 changes: 1 addition & 1 deletion crates/boulder/src/cli/chroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn handle(_command: Command, global: Global) -> Result<(), Error> {

let client = Client::new(config_dir, cache_dir, moss_root)?;

let ephemeral_root = client.cache.join("test-root");
let ephemeral_root = client.cache_dir.join("test-root");

drop(client);

Expand Down
2 changes: 1 addition & 1 deletion crates/boulder/src/cli/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub fn update(client: Client, profile: &profile::Id) -> Result<(), Error> {
let repos = client.repositories(profile)?.clone();

client.block_on(async {
let mut moss_client = moss::Client::new("boulder", &client.moss)
let mut moss_client = moss::Client::new("boulder", &client.moss_dir)
.await?
.explicit_repositories(repos)
.await?;
Expand Down
16 changes: 8 additions & 8 deletions crates/boulder/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use crate::{profile, Profile};

pub struct Client {
pub config: config::Manager,
pub cache: PathBuf,
pub moss: PathBuf,
pub cache_dir: PathBuf,
pub moss_dir: PathBuf,
pub profiles: profile::Map,

runtime: tokio::runtime::Runtime,
Expand All @@ -40,11 +40,11 @@ impl Client {
config::Manager::user("boulder")?
};

let cache = resolve_cache_dir(is_root, cache_dir)?;
let moss = resolve_moss_root(is_root, moss_root)?;
let cache_dir = resolve_cache_dir(is_root, cache_dir)?;
let moss_dir = resolve_moss_root(is_root, moss_root)?;

ensure_dir_exists(&cache)?;
ensure_dir_exists(&moss)?;
ensure_dir_exists(&cache_dir)?;
ensure_dir_exists(&moss_dir)?;

let runtime = runtime::Builder::new_multi_thread().enable_all().build()?;

Expand All @@ -54,8 +54,8 @@ impl Client {

Ok(Self {
config,
cache,
moss,
cache_dir,
moss_dir,
profiles,
runtime,
})
Expand Down

0 comments on commit 1fcd868

Please sign in to comment.