mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-04 10:18:16 +00:00
fix(test): running test as root (#1817)
* fix(test): running test as root The dummy root path /root conflicts with root user's home directory on Linux and redacts incorrectly. Our downstream CI environment builds tinymist in docker as root and encounters the problem. Change the path to `/dummy-root` fixes it. To ensure consistency, other similar occurences are also prefixed with `dummy-`. * dev: deduplicate a bit --------- Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
This commit is contained in:
parent
c0d5f0c800
commit
9d9d360db9
6 changed files with 32 additions and 40 deletions
|
@ -446,9 +446,9 @@ pub(crate) fn file_path(uri: &str) -> String {
|
|||
|
||||
pub(crate) fn file_path_(uri: &lsp_types::Url) -> String {
|
||||
let root = if cfg!(windows) {
|
||||
PathBuf::from("C:\\root")
|
||||
PathBuf::from("C:\\dummy-root")
|
||||
} else {
|
||||
PathBuf::from("/root")
|
||||
PathBuf::from("/dummy-root")
|
||||
};
|
||||
let uri = uri.to_file_path().unwrap();
|
||||
let abs_path = Path::new(&uri).strip_prefix(root).map(|p| p.to_owned());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue