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:
parent
b728f5da24
commit
c690937fd1
4 changed files with 1220 additions and 1749 deletions
|
|
@ -40,7 +40,7 @@
|
||||||
"@hoppscotch/httpsnippet": "3.0.9",
|
"@hoppscotch/httpsnippet": "3.0.9",
|
||||||
"@hoppscotch/js-sandbox": "workspace:^",
|
"@hoppscotch/js-sandbox": "workspace:^",
|
||||||
"@hoppscotch/kernel": "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/ui": "0.2.5",
|
||||||
"@hoppscotch/vue-toasted": "0.1.0",
|
"@hoppscotch/vue-toasted": "0.1.0",
|
||||||
"@lezer/highlight": "1.2.1",
|
"@lezer/highlight": "1.2.1",
|
||||||
|
|
|
||||||
|
|
@ -261,6 +261,7 @@ pub fn run() {
|
||||||
path::get_backup_dir,
|
path::get_backup_dir,
|
||||||
path::get_logs_dir,
|
path::get_logs_dir,
|
||||||
logger::append_log,
|
logger::append_log,
|
||||||
|
path::read_log,
|
||||||
path::get_appload_registry,
|
path::get_appload_registry,
|
||||||
])
|
])
|
||||||
.run(tauri::generate_context!());
|
.run(tauri::generate_context!());
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,20 @@ pub fn get_appload_registry() -> Result<String, String> {
|
||||||
std::fs::read_to_string(®istry_path).map_err(|err| err.to_string())
|
std::fs::read_to_string(®istry_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 {
|
pub fn log_file_path() -> PathBuf {
|
||||||
platform_logs_dir().join(format!("{}.log", APP_ID))
|
platform_logs_dir().join(format!("{}.log", APP_ID))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2952
pnpm-lock.yaml
2952
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue