fix(desktop): add missing backport changes (#6047)

read_log Tauri command (path.rs + lib.rs registration) and
 plugin-appload ref (168ff95 → 0d58d53) were missed during
 the initial SHC backport.
This commit is contained in:
Shreyas 2026-03-26 23:26:21 +05:30 committed by GitHub
parent b728f5da24
commit c690937fd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1220 additions and 1749 deletions

View file

@ -40,7 +40,7 @@
"@hoppscotch/httpsnippet": "3.0.9",
"@hoppscotch/js-sandbox": "workspace:^",
"@hoppscotch/kernel": "workspace:^",
"@hoppscotch/plugin-appload": "github:CuriousCorrelation/tauri-plugin-appload#168ff9533258a56de184fb69ad32f8a7f61bae0d",
"@hoppscotch/plugin-appload": "github:CuriousCorrelation/tauri-plugin-appload#0d58d53be2bc75aeb5916bd0d77794fd209426af",
"@hoppscotch/ui": "0.2.5",
"@hoppscotch/vue-toasted": "0.1.0",
"@lezer/highlight": "1.2.1",

View file

@ -261,6 +261,7 @@ pub fn run() {
path::get_backup_dir,
path::get_logs_dir,
logger::append_log,
path::read_log,
path::get_appload_registry,
])
.run(tauri::generate_context!());

View file

@ -112,6 +112,20 @@ pub fn get_appload_registry() -> Result<String, String> {
std::fs::read_to_string(&registry_path).map_err(|err| err.to_string())
}
// reads the contents of a log file inside `logs_dir()`. same scope
// bypass as `append_log` in logger.rs
#[tauri::command]
pub fn read_log(filename: String) -> Result<String, String> {
let dir = logs_dir().map_err(|e| e.to_string())?;
let path = dir.join(&filename);
if path.parent() != Some(&dir) {
return Err("invalid log filename".to_string());
}
std::fs::read_to_string(&path).map_err(|e| e.to_string())
}
pub fn log_file_path() -> PathBuf {
platform_logs_dir().join(format!("{}.log", APP_ID))
}

File diff suppressed because it is too large Load diff