Skip to content

Commit 82cda98

Browse files
authored
chore(tauri) dirs crate is unmaintained, use dirst-next instead (#1057)
1 parent a3b7247 commit 82cda98

File tree

5 files changed

+28
-22
lines changed

5 files changed

+28
-22
lines changed

.changes/dirs.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-bundler": patch
3+
"tauri-api": patch
4+
---
5+
6+
`dirs` crate is unmaintained, now using `dirs-next` instead.

cli/tauri-bundler/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ edition = "2018"
2020
ar = "0.8.0"
2121
chrono = "0.4"
2222
clap = "^2"
23-
dirs = "2.0.2"
23+
dirs-next = "1.0.2"
2424
glob = "0.3.0"
2525
icns = "0.3"
2626
image = "0.23.10"

cli/tauri-bundler/src/bundle/osx_bundle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use crate::Settings;
2222

2323
use anyhow::Context;
2424
use chrono;
25-
use dirs;
25+
use dirs_next;
2626
use icns;
2727
use image::{self, GenericImageView};
2828

@@ -316,7 +316,7 @@ fn copy_frameworks_to_bundle(bundle_directory: &Path, settings: &Settings) -> cr
316316
framework
317317
)));
318318
}
319-
if let Some(home_dir) = dirs::home_dir() {
319+
if let Some(home_dir) = dirs_next::home_dir() {
320320
if copy_framework_from(&dest_dir, framework, &home_dir.join("Library/Frameworks/"))? {
321321
continue;
322322
}

tauri-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exclude = [ "test/fixture/**" ]
1818
serde = { version = "1.0", features = [ "derive" ] }
1919
serde_json = "1.0"
2020
serde_repr = "0.1"
21-
dirs = "3.0.1"
21+
dirs-next = "1.0.2"
2222
zip = "0.5.8"
2323
semver = "0.11"
2424
tempfile = "3"

tauri-api/src/path.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use serde_repr::{Deserialize_repr, Serialize_repr};
66
/// The base directory is the optional root of a FS operation.
77
/// If informed by the API call, all paths will be relative to the path of the given directory.
88
///
9-
/// For more information, check the [dirs documentation](https://docs.rs/dirs/).
9+
/// For more information, check the [dirs_next documentation](https://docs.rs/dirs_next/).
1010
#[derive(Serialize_repr, Deserialize_repr, Clone, Debug)]
1111
#[repr(u16)]
1212
pub enum BaseDirectory {
@@ -95,82 +95,82 @@ pub fn resolve_path<P: AsRef<Path>>(path: P, dir: Option<BaseDirectory>) -> crat
9595

9696
/// Returns the path to the user's audio directory.
9797
pub fn audio_dir() -> Option<PathBuf> {
98-
dirs::audio_dir()
98+
dirs_next::audio_dir()
9999
}
100100

101101
/// Returns the path to the user's cache directory.
102102
pub fn cache_dir() -> Option<PathBuf> {
103-
dirs::cache_dir()
103+
dirs_next::cache_dir()
104104
}
105105

106106
/// Returns the path to the user's config directory.
107107
pub fn config_dir() -> Option<PathBuf> {
108-
dirs::config_dir()
108+
dirs_next::config_dir()
109109
}
110110

111111
/// Returns the path to the user's data directory.
112112
pub fn data_dir() -> Option<PathBuf> {
113-
dirs::data_dir()
113+
dirs_next::data_dir()
114114
}
115115

116116
/// Returns the path to the user's local data directory.
117117
pub fn local_data_dir() -> Option<PathBuf> {
118-
dirs::data_local_dir()
118+
dirs_next::data_local_dir()
119119
}
120120

121121
/// Returns the path to the user's desktop directory.
122122
pub fn desktop_dir() -> Option<PathBuf> {
123-
dirs::desktop_dir()
123+
dirs_next::desktop_dir()
124124
}
125125

126126
/// Returns the path to the user's document directory.
127127
pub fn document_dir() -> Option<PathBuf> {
128-
dirs::document_dir()
128+
dirs_next::document_dir()
129129
}
130130

131131
/// Returns the path to the user's download directory.
132132
pub fn download_dir() -> Option<PathBuf> {
133-
dirs::download_dir()
133+
dirs_next::download_dir()
134134
}
135135

136136
/// Returns the path to the user's executable directory.
137137
pub fn executable_dir() -> Option<PathBuf> {
138-
dirs::executable_dir()
138+
dirs_next::executable_dir()
139139
}
140140

141141
/// Returns the path to the user's font directory.
142142
pub fn font_dir() -> Option<PathBuf> {
143-
dirs::font_dir()
143+
dirs_next::font_dir()
144144
}
145145

146146
/// Returns the path to the user's home directory.
147147
pub fn home_dir() -> Option<PathBuf> {
148-
dirs::home_dir()
148+
dirs_next::home_dir()
149149
}
150150

151151
/// Returns the path to the user's picture directory.
152152
pub fn picture_dir() -> Option<PathBuf> {
153-
dirs::picture_dir()
153+
dirs_next::picture_dir()
154154
}
155155

156156
/// Returns the path to the user's public directory.
157157
pub fn public_dir() -> Option<PathBuf> {
158-
dirs::public_dir()
158+
dirs_next::public_dir()
159159
}
160160

161161
/// Returns the path to the user's runtime directory.
162162
pub fn runtime_dir() -> Option<PathBuf> {
163-
dirs::runtime_dir()
163+
dirs_next::runtime_dir()
164164
}
165165

166166
/// Returns the path to the user's template directory.
167167
pub fn template_dir() -> Option<PathBuf> {
168-
dirs::template_dir()
168+
dirs_next::template_dir()
169169
}
170170

171171
/// Returns the path to the user's video dir
172172
pub fn video_dir() -> Option<PathBuf> {
173-
dirs::video_dir()
173+
dirs_next::video_dir()
174174
}
175175

176176
/// Returns the path to the resource directory of this app.
@@ -190,7 +190,7 @@ fn app_name() -> crate::Result<String> {
190190

191191
/// Returns the path to the suggested directory for your app config files.
192192
pub fn app_dir() -> Option<PathBuf> {
193-
dirs::config_dir().and_then(|mut dir| {
193+
dirs_next::config_dir().and_then(|mut dir| {
194194
if let Ok(app_name) = app_name() {
195195
dir.push(app_name);
196196
Some(dir)

0 commit comments

Comments
 (0)