bottlerocket-os / bottlerocket-os/twoliter
twoliter: refactor repetitive setup code
- Dominant language
- Rust
- Stars
- 34
- Forks
- 43
- Avg merge
- 11h 13m
- Merged PRs (30d)
- 16
Description
We are doing this too many times:
```rust
let project = project::load_or_find_project(self.project_path.clone()).await?;
let toolsdir = project.project_dir().join("build/tools");
install_tools(&toolsdir).await?;
```
@webern can you suggest a way to factor out the `load_or_find_project` and `install_tools` logic so we don't need to repeat for every command?
_Originally posted by @bcressey in https://github.com/bottlerocket-os/twoliter/pull/230#discussion_r1610786772_
Contributor guide
Research direction
Start by locating the commands that repeat load_or_find_project and install_tools, then read those functions and the surrounding command setup. Determine a shared factoring approach that preserves project loading and build/tools installation across commands. Done means the repeated setup is centralized and all affected commands retain their existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100