mirror of
https://github.com/vrc-get/vrc-get.git
synced 2026-06-21 09:58:08 +00:00
style: reformat with format edition 2024
This commit is contained in:
parent
690a9d1b72
commit
7a7e87ebd0
47 changed files with 123 additions and 115 deletions
|
|
@ -22,11 +22,7 @@ fn main() {
|
|||
};
|
||||
}
|
||||
|
||||
if success {
|
||||
exit(0)
|
||||
} else {
|
||||
exit(1)
|
||||
}
|
||||
if success { exit(0) } else { exit(1) }
|
||||
}
|
||||
|
||||
fn process_mach_64<E: Endian>(binary: &[u8]) -> bool {
|
||||
|
|
@ -75,8 +71,8 @@ fn process_mach_64<E: Endian>(binary: &[u8]) -> bool {
|
|||
}
|
||||
|
||||
fn process_pe_64(binary: &[u8]) -> bool {
|
||||
use object::read::pe::*;
|
||||
use object::LittleEndian as LE;
|
||||
use object::read::pe::*;
|
||||
|
||||
let mut success = true;
|
||||
let parsed = PeFile64::parse(binary).expect("failed to parse binary");
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ pub use start::startup;
|
|||
use tauri::generate_handler;
|
||||
use tauri::ipc::Invoke;
|
||||
pub use uri_custom_scheme::handle_vrc_get_scheme;
|
||||
use vrc_get_vpm::PackageManifest;
|
||||
use vrc_get_vpm::environment::VccDatabaseConnection;
|
||||
use vrc_get_vpm::io::{DefaultEnvironmentIo, DefaultProjectIo};
|
||||
use vrc_get_vpm::unity_project::{
|
||||
AddPackageErr, MigrateUnity2022Error, MigrateVpmError, ReinstalPackagesError, ResolvePackageErr,
|
||||
};
|
||||
use vrc_get_vpm::version::Version;
|
||||
use vrc_get_vpm::PackageManifest;
|
||||
|
||||
// common macro for commands so put it here
|
||||
#[allow(unused_macros)]
|
||||
|
|
@ -46,8 +46,8 @@ mod util;
|
|||
|
||||
mod prelude {
|
||||
pub(super) use super::{
|
||||
load_project, update_project_last_modified, IntoPathBuf as _, RustError,
|
||||
TauriBasePackageInfo, UnityProject,
|
||||
IntoPathBuf as _, RustError, TauriBasePackageInfo, UnityProject, load_project,
|
||||
update_project_last_modified,
|
||||
};
|
||||
pub use crate::state::*;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ use std::collections::HashMap;
|
|||
use std::path::Path;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
||||
use crate::commands::async_command::{async_command, AsyncCallResult, With};
|
||||
use crate::commands::async_command::{AsyncCallResult, With, async_command};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tauri::{Manager, State, Window};
|
||||
use tauri_plugin_dialog::DialogExt;
|
||||
use tokio::fs::write;
|
||||
use url::Url;
|
||||
use vrc_get_vpm::environment::{
|
||||
add_remote_repo, clear_package_cache, AddUserPackageResult, Settings, UserPackageCollection,
|
||||
AddUserPackageResult, Settings, UserPackageCollection, add_remote_repo, clear_package_cache,
|
||||
};
|
||||
use vrc_get_vpm::io::{DefaultEnvironmentIo, IoTrait};
|
||||
use vrc_get_vpm::repositories_file::RepositoriesFile;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use crate::commands::prelude::*;
|
||||
|
||||
use crate::commands::async_command::{async_command, AsyncCallResult, AsyncCommandContext, With};
|
||||
use crate::utils::{collect_notable_project_files_tree, default_project_path, FileSystemTree};
|
||||
use futures::future::try_join_all;
|
||||
use crate::commands::async_command::{AsyncCallResult, AsyncCommandContext, With, async_command};
|
||||
use crate::utils::{FileSystemTree, collect_notable_project_files_tree, default_project_path};
|
||||
use futures::TryStreamExt;
|
||||
use futures::future::try_join_all;
|
||||
use log::{error, info, warn};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::ffi::OsStr;
|
||||
|
|
@ -13,9 +13,9 @@ use std::sync::atomic::AtomicUsize;
|
|||
use tauri::{State, Window};
|
||||
use tauri_plugin_dialog::DialogExt;
|
||||
use tokio::io::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt};
|
||||
use vrc_get_vpm::ProjectType;
|
||||
use vrc_get_vpm::environment::{PackageInstaller, Settings, UserProject, VccDatabaseConnection};
|
||||
use vrc_get_vpm::io::{DefaultEnvironmentIo, DefaultProjectIo, DirEntry, EnvironmentIo, IoTrait};
|
||||
use vrc_get_vpm::ProjectType;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, specta::Type)]
|
||||
pub struct TauriProject {
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@ use std::ffi::OsStr;
|
|||
use std::io;
|
||||
use std::path::Path;
|
||||
|
||||
use crate::commands::prelude::*;
|
||||
use crate::commands::DEFAULT_UNITY_ARGUMENTS;
|
||||
use crate::commands::prelude::*;
|
||||
use crate::utils::{default_project_path, find_existing_parent_dir_or_home, project_backup_path};
|
||||
use log::info;
|
||||
use serde::Serialize;
|
||||
use tauri::async_runtime::spawn;
|
||||
use tauri::{AppHandle, State, Window};
|
||||
use tauri_plugin_dialog::DialogExt;
|
||||
use vrc_get_vpm::environment::{find_unity_hub, VccDatabaseConnection};
|
||||
use vrc_get_vpm::environment::{VccDatabaseConnection, find_unity_hub};
|
||||
use vrc_get_vpm::io::DefaultEnvironmentIo;
|
||||
use vrc_get_vpm::{VRCHAT_RECOMMENDED_2022_UNITY, VRCHAT_RECOMMENDED_2022_UNITY_HUB_LINK};
|
||||
|
||||
|
|
@ -283,7 +283,7 @@ pub async fn environment_pick_unity(
|
|||
.await
|
||||
{
|
||||
Err(ref e) if e.kind() == io::ErrorKind::InvalidInput => {
|
||||
return Ok(TauriPickUnityResult::InvalidSelection)
|
||||
return Ok(TauriPickUnityResult::InvalidSelection);
|
||||
}
|
||||
Err(e) => return Err(e.into()),
|
||||
Ok(_) => {}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ use std::io;
|
|||
use std::mem::forget;
|
||||
use tauri::State;
|
||||
use tokio::spawn;
|
||||
use tokio::sync::oneshot;
|
||||
use tokio::sync::Mutex;
|
||||
use vrc_get_vpm::environment::{find_unity_hub, VccDatabaseConnection};
|
||||
use tokio::sync::oneshot;
|
||||
use vrc_get_vpm::environment::{VccDatabaseConnection, find_unity_hub};
|
||||
use vrc_get_vpm::io::DefaultEnvironmentIo;
|
||||
use vrc_get_vpm::unity_hub;
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ pub async fn update_unity_paths_from_unity_hub(
|
|||
Ok(UpdateUnityResultTiny::Success) => return Ok(true),
|
||||
Ok(UpdateUnityResultTiny::NoUnityHub) => return Ok(false),
|
||||
Ok(UpdateUnityResultTiny::IoError) => {
|
||||
return Err(io::Error::new(io::ErrorKind::Other, "io error"))
|
||||
return Err(io::Error::new(io::ErrorKind::Other, "io error"));
|
||||
}
|
||||
Err(_) => {
|
||||
debug!("previous update failed with panic or was canceled, retrying");
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ use vrc_get_vpm::unity_project::pending_project_changes::{
|
|||
};
|
||||
use vrc_get_vpm::unity_project::{AddPackageOperation, PendingProjectChanges};
|
||||
|
||||
use crate::commands::DEFAULT_UNITY_ARGUMENTS;
|
||||
use crate::commands::async_command::*;
|
||||
use crate::commands::prelude::*;
|
||||
use crate::commands::DEFAULT_UNITY_ARGUMENTS;
|
||||
use crate::utils::{collect_notable_project_files_tree, project_backup_path, PathExt};
|
||||
use crate::utils::{PathExt, collect_notable_project_files_tree, project_backup_path};
|
||||
|
||||
#[derive(Serialize, specta::Type)]
|
||||
pub struct TauriProjectDetails {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::path::Path;
|
||||
|
||||
use crate::commands::async_command::{async_command, AsyncCallResult, With};
|
||||
use crate::commands::async_command::{AsyncCallResult, With, async_command};
|
||||
use crate::commands::prelude::*;
|
||||
use crate::logging::LogEntry;
|
||||
use crate::os::open_that;
|
||||
|
|
@ -159,7 +159,7 @@ pub async fn util_install_and_upgrade(
|
|||
#[specta::specta]
|
||||
pub async fn util_is_bad_hostname() -> Result<bool, RustError> {
|
||||
unsafe {
|
||||
use windows::Win32::NetworkManagement::IpHelper::{GetNetworkParams, FIXED_INFO_W2KSP1};
|
||||
use windows::Win32::NetworkManagement::IpHelper::{FIXED_INFO_W2KSP1, GetNetworkParams};
|
||||
let mut len = 0;
|
||||
// ignore error since expecting ERROR_BUFFER_OVERFLOW
|
||||
GetNetworkParams(None, &mut len).ok().ok();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
|
|||
use std::cmp::Reverse;
|
||||
use std::fmt::{Display, Formatter};
|
||||
use std::io::Write as _;
|
||||
use std::sync::{mpsc, Arc, Mutex};
|
||||
use std::sync::{Arc, Mutex, mpsc};
|
||||
use tauri::{AppHandle, Emitter};
|
||||
use vrc_get_vpm::io::{DefaultEnvironmentIo, EnvironmentIo};
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use std::path::Path;
|
|||
use std::process::Command;
|
||||
use std::sync::OnceLock;
|
||||
|
||||
use nix::libc::{c_short, flock, F_UNLCK};
|
||||
use nix::libc::{F_UNLCK, c_short, flock};
|
||||
|
||||
pub(crate) async fn start_command(_: &OsStr, path: &OsStr, args: &[&OsStr]) -> std::io::Result<()> {
|
||||
let mut command = Command::new(path);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use std::sync::OnceLock;
|
|||
use tokio::process::Command;
|
||||
use windows::Win32::Foundation::{ERROR_LOCK_VIOLATION, HANDLE};
|
||||
use windows::Win32::Storage::FileSystem::{
|
||||
LockFileEx, UnlockFileEx, LOCKFILE_EXCLUSIVE_LOCK, LOCKFILE_FAIL_IMMEDIATELY,
|
||||
LOCKFILE_EXCLUSIVE_LOCK, LOCKFILE_FAIL_IMMEDIATELY, LockFileEx, UnlockFileEx,
|
||||
};
|
||||
use windows::Win32::System::IO::OVERLAPPED;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ use atomicbox::AtomicOptionBox;
|
|||
use futures::TryFutureExt;
|
||||
use std::future::Future;
|
||||
use std::marker::PhantomData;
|
||||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
use vrc_get_vpm::PackageInfo;
|
||||
use vrc_get_vpm::environment::PackageCollection;
|
||||
use vrc_get_vpm::unity_project::PendingProjectChanges;
|
||||
use vrc_get_vpm::PackageInfo;
|
||||
use yoke::{Yoke, Yokeable};
|
||||
|
||||
#[derive(Yokeable)]
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ use arc_swap::ArcSwapOption;
|
|||
use std::future::Future;
|
||||
use std::io;
|
||||
use std::marker::PhantomData;
|
||||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
use std::time::Duration;
|
||||
use vrc_get_vpm::environment::{PackageCollection, Settings};
|
||||
use vrc_get_vpm::io::DefaultEnvironmentIo;
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ mod settings;
|
|||
mod unity_management;
|
||||
|
||||
use crate::io;
|
||||
use crate::repository::local::LocalCachedRepository;
|
||||
use crate::repository::RemoteRepository;
|
||||
use crate::repository::local::LocalCachedRepository;
|
||||
use crate::traits::HttpClient;
|
||||
use crate::utils::to_vec_pretty_os_eol;
|
||||
use futures::prelude::*;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
use std::collections::HashMap;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use crate::PackageCollection as _;
|
||||
use crate::environment::{RepoHolder, Settings, UserPackageCollection};
|
||||
use crate::io::EnvironmentIo;
|
||||
use crate::repository::LocalCachedRepository;
|
||||
use crate::PackageCollection as _;
|
||||
use crate::{io, HttpClient, PackageInfo, PackageManifest, UserRepoSetting, VersionSelector};
|
||||
use crate::{HttpClient, PackageInfo, PackageManifest, UserRepoSetting, VersionSelector, io};
|
||||
use futures::prelude::*;
|
||||
use itertools::Itertools;
|
||||
use log::error;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use crate::io::{EnvironmentIo, ProjectIo};
|
|||
use crate::repository::LocalCachedRepository;
|
||||
use crate::traits::AbortCheck;
|
||||
use crate::utils::Sha256AsyncWrite;
|
||||
use crate::{io, HttpClient, PackageInfo, PackageManifest};
|
||||
use crate::{HttpClient, PackageInfo, PackageManifest, io};
|
||||
use futures::prelude::*;
|
||||
use hex::FromHex;
|
||||
use indexmap::IndexMap;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use crate::environment::settings::Settings;
|
||||
use crate::environment::VccDatabaseConnection;
|
||||
use crate::environment::settings::Settings;
|
||||
use crate::io::{EnvironmentIo, FileSystemProjectIo, ProjectIo};
|
||||
use crate::utils::{check_absolute_path, normalize_path};
|
||||
use crate::version::UnityVersion;
|
||||
use crate::{io, ProjectType, UnityProject};
|
||||
use crate::{ProjectType, UnityProject, io};
|
||||
use futures::future::join_all;
|
||||
use futures::prelude::*;
|
||||
use log::error;
|
||||
|
|
@ -313,9 +313,10 @@ impl VccDatabaseConnection {
|
|||
check_absolute_path(project_path)?;
|
||||
let project_path = normalize_path(project_path.as_ref());
|
||||
|
||||
Ok(pin!(self
|
||||
.db
|
||||
.get_by_index(COLLECTION, "Path", &project_path.to_str().unwrap().into()))
|
||||
Ok(pin!(
|
||||
self.db
|
||||
.get_by_index(COLLECTION, "Path", &project_path.to_str().unwrap().into())
|
||||
)
|
||||
.try_next()
|
||||
.await?)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
use crate::environment::repo_source::RepoSource;
|
||||
use crate::environment::{
|
||||
Settings, CURATED_URL_STR, LOCAL_CURATED_PATH, LOCAL_OFFICIAL_PATH, OFFICIAL_URL_STR,
|
||||
CURATED_URL_STR, LOCAL_CURATED_PATH, LOCAL_OFFICIAL_PATH, OFFICIAL_URL_STR, Settings,
|
||||
};
|
||||
use crate::io::EnvironmentIo;
|
||||
use crate::repository::local::LocalCachedRepository;
|
||||
use crate::repository::RemoteRepository;
|
||||
use crate::repository::local::LocalCachedRepository;
|
||||
use crate::traits::HttpClient;
|
||||
use crate::utils::{read_json_file, to_vec_pretty_os_eol, try_load_json};
|
||||
use crate::{io, UserRepoSetting};
|
||||
use crate::{UserRepoSetting, io};
|
||||
use futures::future::join_all;
|
||||
use indexmap::IndexMap;
|
||||
use lazy_static::lazy_static;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ use crate::io::EnvironmentIo;
|
|||
use crate::package_manifest::LooseManifest;
|
||||
use crate::repository::RemoteRepository;
|
||||
use crate::utils::{normalize_path, try_load_json};
|
||||
use crate::{io, UserRepoSetting};
|
||||
use crate::{UserRepoSetting, io};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Settings {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use super::Settings;
|
||||
use crate::PackageManifest;
|
||||
use crate::io::EnvironmentIo;
|
||||
use crate::package_manifest::LooseManifest;
|
||||
use crate::utils::try_load_json;
|
||||
use crate::PackageManifest;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::UserRepoSetting;
|
||||
use crate::environment::PackageCollection;
|
||||
use crate::io;
|
||||
use crate::io::EnvironmentIo;
|
||||
use crate::utils::{load_json_or_default, save_json};
|
||||
use crate::UserRepoSetting;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::{Map, Value};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ use std::ffi::OsString;
|
|||
use std::future::Future;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
pub(crate) use futures::io::{
|
||||
copy, empty, sink, AsyncRead, AsyncSeek, AsyncWrite, BufReader, Error, ErrorKind, Result,
|
||||
};
|
||||
pub(crate) use futures::Stream;
|
||||
pub(crate) use futures::io::{
|
||||
AsyncRead, AsyncSeek, AsyncWrite, BufReader, Error, ErrorKind, Result, copy, empty, sink,
|
||||
};
|
||||
pub(crate) use std::io::SeekFrom;
|
||||
|
||||
#[cfg(feature = "tokio")]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use crate::repository::{RemotePackages, RemoteRepository};
|
||||
use crate::PackageManifest;
|
||||
use crate::repository::{RemotePackages, RemoteRepository};
|
||||
use indexmap::IndexMap;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use url::Url;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::PackageManifest;
|
||||
use crate::traits::HttpClient;
|
||||
use crate::utils::{deserialize_json, deserialize_json_slice};
|
||||
use crate::version::Version;
|
||||
use crate::PackageManifest;
|
||||
use crate::{io, VersionSelector};
|
||||
use crate::{VersionSelector, io};
|
||||
use futures::prelude::*;
|
||||
use indexmap::IndexMap;
|
||||
use serde::de::{DeserializeSeed, Visitor};
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ mod vpm_manifest;
|
|||
|
||||
use crate::unity_project::upm_manifest::UpmManifest;
|
||||
use crate::unity_project::vpm_manifest::VpmManifest;
|
||||
use crate::utils::{try_load_json, PathBufExt};
|
||||
use crate::utils::{PathBufExt, try_load_json};
|
||||
use crate::version::{UnityVersion, Version, VersionRange};
|
||||
use crate::{io, PackageManifest};
|
||||
use crate::{PackageManifest, io};
|
||||
use futures::future::try_join;
|
||||
use futures::prelude::*;
|
||||
use indexmap::IndexMap;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use crate::io::ProjectIo;
|
|||
use crate::unity_project::package_resolution::MissingDependencies;
|
||||
use crate::unity_project::pending_project_changes::RemoveReason;
|
||||
use crate::unity_project::vpm_manifest::VpmManifest;
|
||||
use crate::unity_project::{package_resolution, PendingProjectChanges};
|
||||
use crate::unity_project::{PendingProjectChanges, package_resolution};
|
||||
use crate::version::DependencyRange;
|
||||
use crate::{PackageCollection, PackageInfo, UnityProject};
|
||||
use log::debug;
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ use crate::io::BufReader;
|
|||
use crate::io::ProjectIo;
|
||||
use crate::utils::walk_dir_relative;
|
||||
use crate::{PackageInfo, PackageManifest, UnityProject};
|
||||
use futures::StreamExt;
|
||||
use futures::prelude::*;
|
||||
use futures::stream::FuturesUnordered;
|
||||
use futures::StreamExt;
|
||||
use hex::FromHex;
|
||||
use log::debug;
|
||||
use std::collections::HashMap;
|
||||
|
|
@ -116,35 +116,37 @@ async fn find_legacy_assets_by_path<'a>(
|
|||
) {
|
||||
use LegacySearchResult::*;
|
||||
|
||||
let mut futures = pin!(assets
|
||||
.map(|info| async move {
|
||||
// some packages uses '/' as path separator.
|
||||
let relative_path = PathBuf::from(info.path.replace('\\', "/")).into_boxed_path();
|
||||
// for security, deny absolute path.
|
||||
if relative_path.is_absolute() {
|
||||
return None;
|
||||
}
|
||||
#[allow(clippy::manual_map)] // it's parallel, not just a if-else
|
||||
if valid_path(&relative_path)
|
||||
&& io
|
||||
.metadata(&relative_path)
|
||||
.await
|
||||
.map(|x| x.is_file() == info.is_file)
|
||||
.unwrap_or(false)
|
||||
&& check_guid(io, relative_path.as_ref(), info.guid).await
|
||||
{
|
||||
Some(FoundWithPath(
|
||||
info.package_name,
|
||||
relative_path,
|
||||
info.is_file,
|
||||
))
|
||||
} else if let Some(guid) = info.guid {
|
||||
Some(SearchWithGuid(info.package_name, guid, info.is_file))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect::<FuturesUnordered<_>>());
|
||||
let mut futures = pin!(
|
||||
assets
|
||||
.map(|info| async move {
|
||||
// some packages uses '/' as path separator.
|
||||
let relative_path = PathBuf::from(info.path.replace('\\', "/")).into_boxed_path();
|
||||
// for security, deny absolute path.
|
||||
if relative_path.is_absolute() {
|
||||
return None;
|
||||
}
|
||||
#[allow(clippy::manual_map)] // it's parallel, not just a if-else
|
||||
if valid_path(&relative_path)
|
||||
&& io
|
||||
.metadata(&relative_path)
|
||||
.await
|
||||
.map(|x| x.is_file() == info.is_file)
|
||||
.unwrap_or(false)
|
||||
&& check_guid(io, relative_path.as_ref(), info.guid).await
|
||||
{
|
||||
Some(FoundWithPath(
|
||||
info.package_name,
|
||||
relative_path,
|
||||
info.is_file,
|
||||
))
|
||||
} else if let Some(guid) = info.guid {
|
||||
Some(SearchWithGuid(info.package_name, guid, info.is_file))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect::<FuturesUnordered<_>>()
|
||||
);
|
||||
|
||||
let mut found_files = HashMap::new();
|
||||
let mut found_folders = HashMap::new();
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::io::ProjectIo;
|
||||
use crate::unity_project::{AddPackageErr, AddPackageOperation};
|
||||
use crate::version::UnityVersion;
|
||||
use crate::{io, PackageInstaller, VRCHAT_RECOMMENDED_2022_UNITY};
|
||||
use crate::{PackageCollection, UnityProject, VersionSelector};
|
||||
use crate::{PackageInstaller, VRCHAT_RECOMMENDED_2022_UNITY, io};
|
||||
use log::warn;
|
||||
|
||||
#[non_exhaustive]
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ use std::collections::HashSet;
|
|||
|
||||
use crate::io::ProjectIo;
|
||||
use crate::unity_project::{AddPackageErr, AddPackageOperation};
|
||||
use crate::{io, PackageInstaller, ProjectType};
|
||||
use crate::{PackageCollection, UnityProject, VersionSelector};
|
||||
use crate::{PackageInstaller, ProjectType, io};
|
||||
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug)]
|
||||
|
|
@ -112,7 +112,10 @@ async fn migrate_vpm(
|
|||
.get_curated_packages(version_selector)
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
debug!("Trying to add the following curated packages to find legacy curated packages with legacyAssets: {:?}", curated_packages);
|
||||
debug!(
|
||||
"Trying to add the following curated packages to find legacy curated packages with legacyAssets: {:?}",
|
||||
curated_packages
|
||||
);
|
||||
|
||||
let packages = project
|
||||
.add_package_request(
|
||||
|
|
|
|||
|
|
@ -315,7 +315,9 @@ where
|
|||
// if already installed version is good, no need to reinstall
|
||||
if let Some(version) = &entry.current {
|
||||
if range.match_pre(version, allow_prerelease) {
|
||||
log::debug!("processing package {name}: dependency {name} version {range}: existing matches");
|
||||
log::debug!(
|
||||
"processing package {name}: dependency {name} version {range}: existing matches"
|
||||
);
|
||||
install = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ use crate::traits::AbortCheck;
|
|||
use crate::unity_project::find_legacy_assets::collect_legacy_assets;
|
||||
use crate::utils::walk_dir_relative;
|
||||
use crate::version::DependencyRange;
|
||||
use crate::{io, PackageInstaller};
|
||||
use crate::{unity_compatible, PackageInfo, UnityProject};
|
||||
use crate::{PackageInfo, UnityProject, unity_compatible};
|
||||
use crate::{PackageInstaller, io};
|
||||
use either::Either;
|
||||
use futures::future::{join, join_all};
|
||||
use futures::prelude::*;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::fmt;
|
|||
|
||||
use crate::io::ProjectIo;
|
||||
use crate::unity_project::package_resolution::MissingDependencies;
|
||||
use crate::unity_project::{pending_project_changes, PendingProjectChanges};
|
||||
use crate::unity_project::{PendingProjectChanges, pending_project_changes};
|
||||
use crate::{PackageCollection, UnityProject, VersionSelector};
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
use crate::io::ProjectIo;
|
||||
use crate::UnityProject;
|
||||
use crate::io::ProjectIo;
|
||||
use std::collections::HashSet;
|
||||
use std::{fmt, io};
|
||||
|
||||
use crate::unity_project::pending_project_changes::RemoveReason;
|
||||
use crate::unity_project::{pending_project_changes, PendingProjectChanges};
|
||||
use crate::unity_project::{PendingProjectChanges, pending_project_changes};
|
||||
|
||||
// removing package
|
||||
impl<IO: ProjectIo> UnityProject<IO> {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use itertools::Itertools;
|
|||
use crate::io::ProjectIo;
|
||||
use crate::unity_project::package_resolution::MissingDependencies;
|
||||
use crate::unity_project::{
|
||||
package_resolution, pending_project_changes, LockedDependencyInfo, PendingProjectChanges,
|
||||
LockedDependencyInfo, PendingProjectChanges, package_resolution, pending_project_changes,
|
||||
};
|
||||
use crate::version::{DependencyRange, PrereleaseAcceptance};
|
||||
use crate::{PackageCollection, UnityProject, VersionSelector};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use crate::io;
|
||||
use crate::io::ProjectIo;
|
||||
use crate::utils::{load_json_or_default, save_json, JsonMapExt, SaveController};
|
||||
use crate::utils::{JsonMapExt, SaveController, load_json_or_default, save_json};
|
||||
use crate::version::Version;
|
||||
use serde::de::Error;
|
||||
use serde::{Deserialize, Deserializer, Serialize};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::io;
|
||||
use crate::io::ProjectIo;
|
||||
use crate::unity_project::LockedDependencyInfo;
|
||||
use crate::utils::{load_json_or_default, save_json, SaveController};
|
||||
use crate::utils::{SaveController, load_json_or_default, save_json};
|
||||
use crate::version::{DependencyRange, Version, VersionRange};
|
||||
use indexmap::IndexMap;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ pub(crate) use sha256_async_write::Sha256AsyncWrite;
|
|||
use std::error::Error;
|
||||
use std::path::{Component, Path, PathBuf};
|
||||
use std::pin::Pin;
|
||||
use std::task::{ready, Context, Poll};
|
||||
use std::task::{Context, Poll, ready};
|
||||
|
||||
pub(crate) trait PathBufExt {
|
||||
fn joined(self, into: impl AsRef<Path>) -> Self;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use pin_project_lite::pin_project;
|
|||
use sha2::digest::Output;
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::pin::Pin;
|
||||
use std::task::{ready, Context, Poll};
|
||||
use std::task::{Context, Poll, ready};
|
||||
|
||||
pin_project! {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use crate::version::{PrereleaseAcceptance, UnityVersion, Version, VersionRange};
|
||||
use crate::{unity_compatible, PackageManifest};
|
||||
use crate::{PackageManifest, unity_compatible};
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct VersionSelector<'a> {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ use futures::executor::block_on;
|
|||
use std::collections::HashSet;
|
||||
use std::io;
|
||||
use std::path::Path;
|
||||
use vrc_get_vpm::PackageManifest;
|
||||
use vrc_get_vpm::io::IoTrait;
|
||||
use vrc_get_vpm::unity_project::pending_project_changes::RemoveReason;
|
||||
use vrc_get_vpm::unity_project::{AddPackageErr, AddPackageOperation};
|
||||
use vrc_get_vpm::version::Version;
|
||||
use vrc_get_vpm::PackageManifest;
|
||||
|
||||
mod common;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ pub use virtual_environment::VirtualEnvironment;
|
|||
pub use virtual_file_system::VirtualFileSystem;
|
||||
pub use virtual_project_builder::VirtualProjectBuilder;
|
||||
|
||||
use vrc_get_vpm::unity_project::pending_project_changes::RemoveReason;
|
||||
use vrc_get_vpm::unity_project::PendingProjectChanges;
|
||||
use vrc_get_vpm::version::{DependencyRange, Version};
|
||||
use vrc_get_vpm::PackageInfo;
|
||||
use vrc_get_vpm::unity_project::PendingProjectChanges;
|
||||
use vrc_get_vpm::unity_project::pending_project_changes::RemoveReason;
|
||||
use vrc_get_vpm::version::{DependencyRange, Version};
|
||||
|
||||
pub fn assert_removed(result: &PendingProjectChanges, package: &str, reason: RemoveReason) {
|
||||
let package_change = result
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use futures::Stream;
|
||||
use indexmap::map::Entry as IndexEntry;
|
||||
use indexmap::IndexMap;
|
||||
use indexmap::map::Entry as IndexEntry;
|
||||
use std::ffi::{OsStr, OsString};
|
||||
use std::future::Future;
|
||||
use std::io::ErrorKind;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::common::*;
|
||||
use futures::executor::block_on;
|
||||
use vrc_get_vpm::version::Version;
|
||||
use vrc_get_vpm::PackageManifest;
|
||||
use vrc_get_vpm::version::Version;
|
||||
|
||||
mod common;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ use itertools::Itertools;
|
|||
|
||||
use futures::future::join_all;
|
||||
use log::warn;
|
||||
use reqwest::header::{HeaderName, HeaderValue, InvalidHeaderName, InvalidHeaderValue};
|
||||
use reqwest::Url;
|
||||
use reqwest::header::{HeaderName, HeaderValue, InvalidHeaderName, InvalidHeaderValue};
|
||||
use serde::Serialize;
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
|
|
@ -18,8 +18,8 @@ use std::process::exit;
|
|||
use std::str::FromStr;
|
||||
use tokio::fs::read_to_string;
|
||||
use vrc_get_vpm::environment::{
|
||||
add_remote_repo, cleanup_repos_folder, clear_package_cache, AddRepositoryErr,
|
||||
AddUserPackageResult, PackageCollection, PackageInstaller, Settings, UserPackageCollection,
|
||||
AddRepositoryErr, AddUserPackageResult, PackageCollection, PackageInstaller, Settings,
|
||||
UserPackageCollection, add_remote_repo, cleanup_repos_folder, clear_package_cache,
|
||||
};
|
||||
use vrc_get_vpm::io::{DefaultEnvironmentIo, DefaultProjectIo, IoTrait};
|
||||
use vrc_get_vpm::repositories_file::RepositoriesFile;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use super::{load_collection, UnityProject};
|
||||
use super::{UnityProject, load_collection};
|
||||
use crate::commands::load_unity;
|
||||
use clap::{Parser, Subcommand};
|
||||
use itertools::Itertools;
|
||||
|
|
@ -6,9 +6,9 @@ use serde::Serialize;
|
|||
use std::collections::HashSet;
|
||||
use std::num::NonZeroU32;
|
||||
use std::path::Path;
|
||||
use vrc_get_vpm::PackageCollection;
|
||||
use vrc_get_vpm::io::DefaultEnvironmentIo;
|
||||
use vrc_get_vpm::version::{UnityVersion, Version, VersionRange};
|
||||
use vrc_get_vpm::PackageCollection;
|
||||
|
||||
/// Shows information for other program.
|
||||
#[derive(Subcommand)]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use crate::commands::{
|
||||
confirm_prompt, load_collection, load_unity, update_project_last_modified, EnvArgs, ResultExt,
|
||||
EnvArgs, ResultExt, confirm_prompt, load_collection, load_unity, update_project_last_modified,
|
||||
};
|
||||
use clap::{Parser, Subcommand};
|
||||
use log::info;
|
||||
|
|
@ -63,7 +63,9 @@ impl Unity2022 {
|
|||
.await
|
||||
.exit_context("migrating unity project");
|
||||
|
||||
info!("Updating manifest file finished successfully. Launching Unity to finalize migration...");
|
||||
info!(
|
||||
"Updating manifest file finished successfully. Launching Unity to finalize migration..."
|
||||
);
|
||||
|
||||
#[cfg(not(feature = "experimental-vcc"))]
|
||||
let unity = self.unity;
|
||||
|
|
@ -78,7 +80,9 @@ impl Unity2022 {
|
|||
.await
|
||||
.exit_context("getting unity 2022 path")
|
||||
else {
|
||||
exit_with!("Unity 2022 not found. please load from unity hub with `vrc-get vcc unity update` or specify path with `--unity` option.")
|
||||
exit_with!(
|
||||
"Unity 2022 not found. please load from unity hub with `vrc-get vcc unity update` or specify path with `--unity` option."
|
||||
)
|
||||
};
|
||||
|
||||
if found.version() != Some(VRCHAT_RECOMMENDED_2022_UNITY) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
use crate::commands::{absolute_path, ResultExt};
|
||||
use crate::commands::{ResultExt, absolute_path};
|
||||
use clap::{Parser, Subcommand};
|
||||
use log::warn;
|
||||
use std::cmp::Reverse;
|
||||
use std::path::Path;
|
||||
use vrc_get_vpm::environment::{find_unity_hub, Settings, VccDatabaseConnection};
|
||||
use vrc_get_vpm::environment::{Settings, VccDatabaseConnection, find_unity_hub};
|
||||
use vrc_get_vpm::io::{DefaultEnvironmentIo, DefaultProjectIo};
|
||||
use vrc_get_vpm::{unity_hub, UnityProject};
|
||||
use vrc_get_vpm::{UnityProject, unity_hub};
|
||||
|
||||
/// Experimental VCC commands
|
||||
#[derive(Subcommand)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue