소스 검색

chore(tauri) `dirs` crate is unmaintained, use `dirst-next` instead (#1057)

Lucas Fernandes Nogueira 4 년 전
부모
커밋
82cda98532
5개의 변경된 파일28개의 추가작업 그리고 22개의 파일을 삭제
  1. 6 0
      .changes/dirs.md
  2. 1 1
      cli/tauri-bundler/Cargo.toml
  3. 2 2
      cli/tauri-bundler/src/bundle/osx_bundle.rs
  4. 1 1
      tauri-api/Cargo.toml
  5. 18 18
      tauri-api/src/path.rs

+ 6 - 0
.changes/dirs.md

@@ -0,0 +1,6 @@
+---
+"tauri-bundler": patch
+"tauri-api": patch
+---
+
+`dirs` crate is unmaintained, now using `dirs-next` instead.

+ 1 - 1
cli/tauri-bundler/Cargo.toml

@@ -20,7 +20,7 @@ edition = "2018"
 ar = "0.8.0"
 chrono = "0.4"
 clap = "^2"
-dirs = "2.0.2"
+dirs-next = "1.0.2"
 glob = "0.3.0"
 icns = "0.3"
 image = "0.23.10"

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

@@ -22,7 +22,7 @@ use crate::Settings;
 
 use anyhow::Context;
 use chrono;
-use dirs;
+use dirs_next;
 use icns;
 use image::{self, GenericImageView};
 
@@ -316,7 +316,7 @@ fn copy_frameworks_to_bundle(bundle_directory: &Path, settings: &Settings) -> cr
         framework
       )));
     }
-    if let Some(home_dir) = dirs::home_dir() {
+    if let Some(home_dir) = dirs_next::home_dir() {
       if copy_framework_from(&dest_dir, framework, &home_dir.join("Library/Frameworks/"))? {
         continue;
       }

+ 1 - 1
tauri-api/Cargo.toml

@@ -18,7 +18,7 @@ exclude = [ "test/fixture/**" ]
 serde = { version = "1.0", features = [ "derive" ] }
 serde_json = "1.0"
 serde_repr = "0.1"
-dirs = "3.0.1"
+dirs-next = "1.0.2"
 zip = "0.5.8"
 semver = "0.11"
 tempfile = "3"

+ 18 - 18
tauri-api/src/path.rs

@@ -6,7 +6,7 @@ use serde_repr::{Deserialize_repr, Serialize_repr};
 /// The base directory is the optional root of a FS operation.
 /// If informed by the API call, all paths will be relative to the path of the given directory.
 ///
-/// For more information, check the [dirs documentation](https://docs.rs/dirs/).
+/// For more information, check the [dirs_next documentation](https://docs.rs/dirs_next/).
 #[derive(Serialize_repr, Deserialize_repr, Clone, Debug)]
 #[repr(u16)]
 pub enum BaseDirectory {
@@ -95,82 +95,82 @@ pub fn resolve_path<P: AsRef<Path>>(path: P, dir: Option<BaseDirectory>) -> crat
 
 /// Returns the path to the user's audio directory.
 pub fn audio_dir() -> Option<PathBuf> {
-  dirs::audio_dir()
+  dirs_next::audio_dir()
 }
 
 /// Returns the path to the user's cache directory.
 pub fn cache_dir() -> Option<PathBuf> {
-  dirs::cache_dir()
+  dirs_next::cache_dir()
 }
 
 /// Returns the path to the user's config directory.
 pub fn config_dir() -> Option<PathBuf> {
-  dirs::config_dir()
+  dirs_next::config_dir()
 }
 
 /// Returns the path to the user's data directory.
 pub fn data_dir() -> Option<PathBuf> {
-  dirs::data_dir()
+  dirs_next::data_dir()
 }
 
 /// Returns the path to the user's local data directory.
 pub fn local_data_dir() -> Option<PathBuf> {
-  dirs::data_local_dir()
+  dirs_next::data_local_dir()
 }
 
 /// Returns the path to the user's desktop directory.
 pub fn desktop_dir() -> Option<PathBuf> {
-  dirs::desktop_dir()
+  dirs_next::desktop_dir()
 }
 
 /// Returns the path to the user's document directory.
 pub fn document_dir() -> Option<PathBuf> {
-  dirs::document_dir()
+  dirs_next::document_dir()
 }
 
 /// Returns the path to the user's download directory.
 pub fn download_dir() -> Option<PathBuf> {
-  dirs::download_dir()
+  dirs_next::download_dir()
 }
 
 /// Returns the path to the user's executable directory.
 pub fn executable_dir() -> Option<PathBuf> {
-  dirs::executable_dir()
+  dirs_next::executable_dir()
 }
 
 /// Returns the path to the user's font directory.
 pub fn font_dir() -> Option<PathBuf> {
-  dirs::font_dir()
+  dirs_next::font_dir()
 }
 
 /// Returns the path to the user's home directory.
 pub fn home_dir() -> Option<PathBuf> {
-  dirs::home_dir()
+  dirs_next::home_dir()
 }
 
 /// Returns the path to the user's picture directory.
 pub fn picture_dir() -> Option<PathBuf> {
-  dirs::picture_dir()
+  dirs_next::picture_dir()
 }
 
 /// Returns the path to the user's public directory.
 pub fn public_dir() -> Option<PathBuf> {
-  dirs::public_dir()
+  dirs_next::public_dir()
 }
 
 /// Returns the path to the user's runtime directory.
 pub fn runtime_dir() -> Option<PathBuf> {
-  dirs::runtime_dir()
+  dirs_next::runtime_dir()
 }
 
 /// Returns the path to the user's template directory.
 pub fn template_dir() -> Option<PathBuf> {
-  dirs::template_dir()
+  dirs_next::template_dir()
 }
 
 /// Returns the path to the user's video dir
 pub fn video_dir() -> Option<PathBuf> {
-  dirs::video_dir()
+  dirs_next::video_dir()
 }
 
 /// Returns the path to the resource directory of this app.
@@ -190,7 +190,7 @@ fn app_name() -> crate::Result<String> {
 
 /// Returns the path to the suggested directory for your app config files.
 pub fn app_dir() -> Option<PathBuf> {
-  dirs::config_dir().and_then(|mut dir| {
+  dirs_next::config_dir().and_then(|mut dir| {
     if let Ok(app_name) = app_name() {
       dir.push(app_name);
       Some(dir)