Make mount no-op on unsupported targets
This commit is contained in:
parent
4a7d489ff4
commit
7bdfcd6ca8
|
@ -5,3 +5,7 @@ members = [
|
|||
"rustcryptfs-fuse",
|
||||
"rustcryptfs-mount"
|
||||
]
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
codegen-units = 1
|
|
@ -9,6 +9,10 @@ An implementation of [gocryptfs](https://github.com/rfjakob/gocryptfs) in Rust.
|
|||
- [ ] read
|
||||
- [ ] write
|
||||
|
||||
## Features
|
||||
- mount\
|
||||
Allow to mount a virtual filesystem on linux or windows (unimplemented). This feature is no-op on other targets.
|
||||
|
||||
## License
|
||||
|
||||
Licensed under either of
|
||||
|
|
|
@ -19,6 +19,7 @@ pub(crate) enum Commands {
|
|||
Ls(LsCommand),
|
||||
|
||||
#[cfg(feature = "mount")]
|
||||
#[cfg(any(target_os = "linux", target_os = "windows"))]
|
||||
/// Mount an encrypted folder
|
||||
Mount(MountCommand),
|
||||
}
|
||||
|
@ -52,6 +53,7 @@ pub(crate) struct LsCommand {
|
|||
}
|
||||
|
||||
#[cfg(feature = "mount")]
|
||||
#[cfg(any(target_os = "linux", target_os = "windows"))]
|
||||
#[derive(Debug, Parser)]
|
||||
pub(crate) struct MountCommand {
|
||||
/// The directory
|
||||
|
|
|
@ -10,6 +10,7 @@ use args::{DecryptCommand, LsCommand};
|
|||
use rustcryptfs_lib::GocryptFs;
|
||||
|
||||
#[cfg(feature = "mount")]
|
||||
#[cfg(any(target_os = "linux", target_os = "windows"))]
|
||||
use args::MountCommand;
|
||||
|
||||
mod args;
|
||||
|
@ -22,6 +23,7 @@ fn main() -> anyhow::Result<()> {
|
|||
args::Commands::Decrypt(c) => decrypt_file(c),
|
||||
args::Commands::Ls(c) => ls(c),
|
||||
#[cfg(feature = "mount")]
|
||||
#[cfg(any(target_os = "linux", target_os = "windows"))]
|
||||
args::Commands::Mount(c) => mount(c),
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +137,7 @@ fn mount(mount: &MountCommand) -> anyhow::Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
#[cfg(target_os = "windows")]
|
||||
#[cfg(feature = "mount")]
|
||||
fn mount(mount: &MountCommand) -> anyhow::Result<()> {
|
||||
unimplemented!()
|
||||
|
|
Loading…
Reference in New Issue