We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a22d84d commit 700c1b9Copy full SHA for 700c1b9
src-tauri/src/device_manager/privkey.rs
@@ -10,8 +10,14 @@ impl PrivateKey {
10
pub fn content(&self, ssh_dir: Option<&Path>) -> Result<String, Error> {
11
match self {
12
PrivateKey::Path { name } => {
13
- let mut secret_file =
14
- std::fs::File::open(ssh_dir.ok_or(Error::bad_config())?.join(name))?;
+ let mut ssh_dir = ssh_dir.ok_or(Error::bad_config())?;
+ if cfg!(mobile) {
15
+ let ssh_parent = ssh_dir.parent().ok_or(Error::bad_config())?;
16
+ if ssh_parent.join(name).is_file() {
17
+ ssh_dir = ssh_parent;
18
+ }
19
20
+ let mut secret_file = std::fs::File::open(ssh_dir.join(name))?;
21
let mut secret = String::new();
22
secret_file.read_to_string(&mut secret)?;
23
Ok(secret)
0 commit comments