You've already forked AstralRinth
forked from didirus/AstralRinth
debugging; box pinning (#101)
This commit is contained in:
Vendored
+23
-1
@@ -133,6 +133,28 @@
|
|||||||
},
|
},
|
||||||
"args": [],
|
"args": [],
|
||||||
"cwd": "${workspaceFolder}"
|
"cwd": "${workspaceFolder}"
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Tauri Development Debug",
|
||||||
|
"cargo": {
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"--manifest-path=./theseus_gui/src-tauri/Cargo.toml",
|
||||||
|
"--no-default-features"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"preLaunchTask": "ui:dev"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Tauri Production Debug",
|
||||||
|
"cargo": {
|
||||||
|
"args": ["build", "--release", "--manifest-path=.theseus_gui/src-tauri/Cargo.toml"]
|
||||||
|
},
|
||||||
|
"preLaunchTask": "ui:build"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Vendored
+32
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "ui:dev",
|
||||||
|
"type": "shell",
|
||||||
|
// `dev` keeps running in the background
|
||||||
|
// ideally you should also configure a `problemMatcher`
|
||||||
|
// see https://code.visualstudio.com/docs/editor/tasks#_can-a-background-task-be-used-as-a-prelaunchtask-in-launchjson
|
||||||
|
"isBackground": true,
|
||||||
|
// change this to your `beforeDevCommand`:
|
||||||
|
"command": "yarn",
|
||||||
|
"args": ["dev"],
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}/theseus_gui"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "ui:build",
|
||||||
|
"type": "shell",
|
||||||
|
// change this to your `beforeBuildCommand`:
|
||||||
|
"command": "yarn",
|
||||||
|
"args": ["build"],
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}/theseus_gui"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
}
|
||||||
+21
-16
@@ -89,24 +89,29 @@ pub async fn list() -> crate::Result<std::collections::HashMap<PathBuf, Profile>
|
|||||||
/// Query + sync profile's projects with the UI from the FS
|
/// Query + sync profile's projects with the UI from the FS
|
||||||
#[tracing::instrument]
|
#[tracing::instrument]
|
||||||
pub async fn sync(path: &Path) -> crate::Result<()> {
|
pub async fn sync(path: &Path) -> crate::Result<()> {
|
||||||
let state = State::get().await?;
|
Box::pin({
|
||||||
let result = {
|
async move {
|
||||||
let mut profiles: tokio::sync::RwLockWriteGuard<
|
let state = State::get().await?;
|
||||||
crate::state::Profiles,
|
let result = {
|
||||||
> = state.profiles.write().await;
|
let mut profiles: tokio::sync::RwLockWriteGuard<
|
||||||
|
crate::state::Profiles,
|
||||||
|
> = state.profiles.write().await;
|
||||||
|
|
||||||
if let Some(profile) = profiles.0.get_mut(path) {
|
if let Some(profile) = profiles.0.get_mut(path) {
|
||||||
profile.sync().await?;
|
profile.sync().await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(crate::ErrorKind::UnmanagedProfileError(
|
Err(crate::ErrorKind::UnmanagedProfileError(
|
||||||
path.display().to_string(),
|
path.display().to_string(),
|
||||||
)
|
)
|
||||||
.as_error())
|
.as_error())
|
||||||
|
}
|
||||||
|
};
|
||||||
|
State::sync().await?;
|
||||||
|
result
|
||||||
}
|
}
|
||||||
};
|
})
|
||||||
State::sync().await?;
|
.await
|
||||||
result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Installs/Repairs a profile
|
/// Installs/Repairs a profile
|
||||||
|
|||||||
+24
-23
@@ -138,34 +138,35 @@ impl State {
|
|||||||
#[tracing::instrument]
|
#[tracing::instrument]
|
||||||
/// Synchronize in-memory state with persistent state
|
/// Synchronize in-memory state with persistent state
|
||||||
pub async fn sync() -> crate::Result<()> {
|
pub async fn sync() -> crate::Result<()> {
|
||||||
let state = Self::get().await?;
|
Box::pin(async move {
|
||||||
|
let state = Self::get().await?;
|
||||||
|
let sync_settings = async {
|
||||||
|
let state = Arc::clone(&state);
|
||||||
|
|
||||||
let sync_settings = async {
|
tokio::spawn(async move {
|
||||||
let state = Arc::clone(&state);
|
let reader = state.settings.read().await;
|
||||||
|
reader.sync(&state.directories.settings_file()).await?;
|
||||||
|
Ok::<_, crate::Error>(())
|
||||||
|
})
|
||||||
|
.await?
|
||||||
|
};
|
||||||
|
|
||||||
tokio::spawn(async move {
|
let sync_profiles = async {
|
||||||
let reader = state.settings.read().await;
|
let state = Arc::clone(&state);
|
||||||
reader.sync(&state.directories.settings_file()).await?;
|
|
||||||
Ok::<_, crate::Error>(())
|
|
||||||
})
|
|
||||||
.await?
|
|
||||||
};
|
|
||||||
|
|
||||||
let sync_profiles = async {
|
tokio::spawn(async move {
|
||||||
let state = Arc::clone(&state);
|
let profiles = state.profiles.read().await;
|
||||||
|
|
||||||
tokio::spawn(async move {
|
profiles.sync().await?;
|
||||||
let profiles = state.profiles.read().await;
|
Ok::<_, crate::Error>(())
|
||||||
|
})
|
||||||
|
.await?
|
||||||
|
};
|
||||||
|
|
||||||
profiles.sync().await?;
|
tokio::try_join!(sync_settings, sync_profiles)?;
|
||||||
Ok::<_, crate::Error>(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.await?
|
.await
|
||||||
};
|
|
||||||
|
|
||||||
tokio::try_join!(sync_settings, sync_profiles)?;
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reset semaphores to default values
|
/// Reset semaphores to default values
|
||||||
|
|||||||
@@ -358,13 +358,7 @@ pub async fn infer_data_from_files(
|
|||||||
.filter(|x| x.team_id == project.team)
|
.filter(|x| x.team_id == project.team)
|
||||||
.cloned()
|
.cloned()
|
||||||
.collect::<Vec<_>>(),
|
.collect::<Vec<_>>(),
|
||||||
update_version: if let Some(val) =
|
update_version: update_versions.get(&hash).map(|val| Box::new(val.clone())),
|
||||||
update_versions.get(&hash)
|
|
||||||
{
|
|
||||||
Some(Box::new(val.clone()))
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
},
|
|
||||||
|
|
||||||
incompatible: !version.loaders.contains(
|
incompatible: !version.loaders.contains(
|
||||||
&profile
|
&profile
|
||||||
|
|||||||
Reference in New Issue
Block a user