You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/helpers/filesystem.rs
-50Lines changed: 0 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -114,53 +114,3 @@ pub async fn copy_dir_async(
114
114
115
115
Ok(())
116
116
}
117
-
118
-
/// Copies a directory from one location to another.
119
-
///
120
-
/// This function takes two arguments: the source directory and the destination directory. Both arguments are implemented as references to `Path` and are static.
121
-
/// It first creates the destination directory, then reads the entries of the source directory.
122
-
/// For each entry in the source directory, it checks if the entry is a directory or a file.
123
-
/// If the entry is a directory, it recursively calls `copy_dir` to copy the directory to the destination.
124
-
/// If the entry is a file, it copies the file to the destination.
125
-
///
126
-
/// # Arguments
127
-
///
128
-
/// * `from` - A reference to a `Path` representing the source directory.
129
-
/// * `to` - A reference to a `Path` representing the destination directory.
130
-
///
131
-
/// # Returns
132
-
///
133
-
/// This function returns a `Result` that indicates whether the operation was successful.
134
-
/// If the operation was successful, the function returns `Ok(())`.
135
-
/// If the operation failed, the function returns `Err` with a description of the error.
Copy file name to clipboardExpand all lines: src/helpers/mod.rs
+2-6Lines changed: 2 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,6 @@ pub mod checksum;
2
2
pubmod directories;
3
3
pubmod filesystem;
4
4
pubmod processes;
5
-
pubmod sync;
6
5
pubmod unarchive;
7
6
pubmod version;
8
7
use semver::Version;
@@ -11,8 +10,7 @@ use semver::Version;
11
10
///
12
11
/// This function checks the target operating system using the `cfg!` macro and returns a string that corresponds to the appropriate file type for the Neovim binary download.
13
12
/// For Windows, it returns "zip".
14
-
/// For macOS, it returns "tar.gz".
15
-
/// For other operating systems, it returns "appimage".
/// This function is specific to Linux due to the use of certain features like `os::unix::fs::PermissionsExt`.
67
-
/// It takes a `LocalVersion` struct which contains information about the downloaded file, such as its name and format.
68
-
/// The function then checks if a directory with the same name as the downloaded file exists, and if so, removes it.
69
-
/// It then sets the permissions of the downloaded file to `0o551` and extracts its contents using the `--appimage-extract` command.
70
-
/// After extraction, the function renames the `squashfs-root` directory to the name of the downloaded file and changes the current directory to the renamed directory.
71
-
/// It then removes certain files and renames the `usr` directory to `nvim-linux64`.
72
-
/// Finally, it changes the current directory back to the parent directory.
73
-
///
74
-
/// # Arguments
75
-
///
76
-
/// * `downloaded_file` - A `LocalVersion` struct representing the downloaded file.
77
-
///
78
-
/// # Returns
79
-
///
80
-
/// This function returns a `Result` that indicates whether the operation was successful.
81
-
/// If the operation was successful, the function returns `Ok(())`.
82
-
/// If the operation failed, the function returns `Err` with a description of the error.
83
-
///
84
-
/// # Errors
85
-
///
86
-
/// This function will return an error if:
87
-
///
88
-
/// * A directory with the same name as the downloaded file could not be removed.
89
-
/// * The permissions of the downloaded file could not be set.
90
-
/// * The downloaded file could not be extracted.
91
-
/// * The `squashfs-root` directory could not be renamed.
#[cfg(target_os = "macos")]// I don't know if its worth making both expand functions into one function, but the API difference will cause so much if statements
0 commit comments