mirror of https://github.com/tauri-apps/tauri
refactor(core): remove `BaseDirectory::Current` variant
This commit is contained in:
parent
c80e8b6886
commit
696dca58a9
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
"tauri": patch
|
||||
"api": patch
|
||||
---
|
||||
|
||||
Remove the `BaseDirectory::Current` enum variant for security reasons.
|
File diff suppressed because one or more lines are too long
|
@ -4,10 +4,7 @@
|
|||
|
||||
//! Types and functions related to file system path operations.
|
||||
|
||||
use std::{
|
||||
env,
|
||||
path::{Component, Path, PathBuf},
|
||||
};
|
||||
use std::path::{Component, Path, PathBuf};
|
||||
|
||||
use crate::{Config, Env, PackageInfo};
|
||||
|
||||
|
@ -60,8 +57,6 @@ pub enum BaseDirectory {
|
|||
/// The default App config directory.
|
||||
/// Resolves to [`BaseDirectory::Config`].
|
||||
App,
|
||||
/// The current working directory.
|
||||
Current,
|
||||
/// The Log directory.
|
||||
/// Resolves to [`BaseDirectory::Home/Library/Logs/{bundle_identifier}`] on macOS
|
||||
/// and [`BaseDirectory::Config/{bundle_identifier}/logs`] on linux and windows.
|
||||
|
@ -90,7 +85,6 @@ impl BaseDirectory {
|
|||
Self::Video => "$VIDEO",
|
||||
Self::Resource => "$RESOURCE",
|
||||
Self::App => "$APP",
|
||||
Self::Current => "$CWD",
|
||||
Self::Log => "$LOG",
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +110,6 @@ impl BaseDirectory {
|
|||
"$VIDEO" => Self::Video,
|
||||
"$RESOURCE" => Self::Resource,
|
||||
"$APP" => Self::App,
|
||||
"$CWD" => Self::Current,
|
||||
"$LOG" => Self::Log,
|
||||
_ => return None,
|
||||
};
|
||||
|
@ -206,7 +199,6 @@ pub fn resolve_path<P: AsRef<Path>>(
|
|||
BaseDirectory::Video => video_dir(),
|
||||
BaseDirectory::Resource => resource_dir(package_info, env),
|
||||
BaseDirectory::App => app_dir(config),
|
||||
BaseDirectory::Current => Some(env::current_dir()?),
|
||||
BaseDirectory::Log => log_dir(config),
|
||||
};
|
||||
if let Some(mut base_dir_path_value) = base_dir_path {
|
||||
|
|
|
@ -52,7 +52,6 @@ export enum BaseDirectory {
|
|||
Video,
|
||||
Resource,
|
||||
App,
|
||||
Current,
|
||||
Log
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue