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