mirror of
https://github.com/veeso/termscp.git
synced 2026-09-26 22:11:26 -07:00
feat: Import bookmarks from ssh config with a CLI command (#364)
* feat: Import bookmarks from ssh config with a CLI command Use import-ssh-hosts to import all the possible hosts by the configured ssh config or the default one on your machine closes #331
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use tui_realm_stdlib::Input;
|
||||
use tuirealm::command::{Cmd, CmdResult, Direction, Position};
|
||||
@@ -158,7 +158,7 @@ impl OwnStates {
|
||||
.unwrap_or_else(|| PathBuf::from("/"));
|
||||
|
||||
// if path is `.`, then return None
|
||||
if parent == PathBuf::from(".") {
|
||||
if parent == Path::new(".") {
|
||||
return Suggestion::None;
|
||||
}
|
||||
|
||||
|
||||
@@ -506,10 +506,10 @@ impl Activity for FileTransferActivity {
|
||||
/// This function must be called once before terminating the activity.
|
||||
fn on_destroy(&mut self) -> Option<Context> {
|
||||
// Destroy cache
|
||||
if let Some(cache) = self.cache.take() {
|
||||
if let Err(err) = cache.close() {
|
||||
error!("Failed to delete cache: {}", err);
|
||||
}
|
||||
if let Some(cache) = self.cache.take()
|
||||
&& let Err(err) = cache.close()
|
||||
{
|
||||
error!("Failed to delete cache: {}", err);
|
||||
}
|
||||
// Disable raw mode
|
||||
if let Err(err) = self.context_mut().terminal().disable_raw_mode() {
|
||||
|
||||
Reference in New Issue
Block a user