refactor: remove unused imports

This commit is contained in:
daimond113 2025-04-26 23:59:29 +02:00
parent 91229d92be
commit a127e2fcbb
No known key found for this signature in database
GPG key ID: 640DC95EC1190354
4 changed files with 18 additions and 16 deletions

View file

@ -11,18 +11,15 @@ use console::style;
use fs_err::tokio as fs;
use pesde::{
download_and_link::{DownloadAndLinkHooks, DownloadAndLinkOptions, InstallDependenciesMode},
engine::EngineKind,
graph::{DependencyGraph, DependencyGraphWithTarget},
lockfile::Lockfile,
manifest::{DependencyType, Manifest},
manifest::DependencyType,
names::PackageNames,
source::{
pesde::PesdePackageSource,
refs::PackageRefs,
traits::{PackageRef as _, RefreshOptions},
PackageSources,
},
version_matches, Project, RefreshedSources, MANIFEST_FILE_NAME,
Project, RefreshedSources,
};
use std::{
collections::{BTreeMap, BTreeSet, HashSet},
@ -284,6 +281,8 @@ pub async fn install(
#[cfg(feature = "version-management")]
{
use pesde::{source::{refs::PackageRefs, pesde::PesdePackageSource}, MANIFEST_FILE_NAME, version_matches, manifest::Manifest, engine::EngineKind};
let manifest_target_kind = manifest.target.kind();
let mut tasks = downloaded_graph.iter()
.map(|(id, node)| {

View file

@ -23,7 +23,6 @@ use pesde::{
Project, DEFAULT_INDEX_NAME,
};
use relative_path::RelativePathBuf;
use reporters::run_with_reporter;
use semver::Version;
use std::{
collections::{BTreeMap, HashMap, HashSet},
@ -59,6 +58,7 @@ pub fn bin_dir() -> anyhow::Result<PathBuf> {
Ok(base_dir()?.join("bin"))
}
#[cfg(feature = "version-management")]
pub fn engines_dir() -> anyhow::Result<PathBuf> {
Ok(base_dir()?.join("engines"))
}
@ -375,7 +375,7 @@ pub async fn get_project_engines(
) -> anyhow::Result<HashMap<EngineKind, Version>> {
use tokio::task::JoinSet;
run_with_reporter(|_, root_progress, reporter| async {
crate::cli::reporters::run_with_reporter(|_, root_progress, reporter| async {
let root_progress = root_progress;
let reporter = reporter;

View file

@ -29,7 +29,7 @@ pub mod incremental;
async fn create_and_canonicalize<P: AsRef<Path>>(path: P) -> std::io::Result<PathBuf> {
let p = path.as_ref();
fs::create_dir_all(p).await?;
p.canonicalize()
fs::canonicalize(p).await
}
async fn write_cas(destination: PathBuf, cas_dir: &Path, contents: &str) -> std::io::Result<()> {

View file

@ -7,10 +7,9 @@ use cli::{compatible_runtime, data_dir, get_project_engines};
use fs_err::tokio as fs;
use indicatif::MultiProgress;
use pesde::{
engine::EngineKind, find_roots, manifest::target::TargetKind, version_matches, AuthConfig,
Project, MANIFEST_FILE_NAME,
engine::EngineKind, find_roots, manifest::target::TargetKind, AuthConfig, Project,
MANIFEST_FILE_NAME,
};
use semver::VersionReq;
use std::{
collections::HashMap,
io,
@ -332,15 +331,19 @@ async fn run() -> anyhow::Result<()> {
if engine == EngineKind::Pesde {
match &req {
// we're already running a compatible version
Some(req) if version_matches(req, &current_version()) => break 'engines,
Some(req) if pesde::version_matches(req, &current_version()) => break 'engines,
// the user has not requested a specific version, so we'll just use the current one
None => break 'engines,
_ => (),
}
}
let exe_path =
get_or_download_engine(&reqwest, engine, req.unwrap_or(VersionReq::STAR), ().into())
let exe_path = get_or_download_engine(
&reqwest,
engine,
req.unwrap_or(semver::VersionReq::STAR),
().into(),
)
.await?
.0;
if exe_path == current_exe {