mirror of
https://github.com/veeso/termscp.git
synced 2026-09-26 05:51:20 -07:00
fix: start activity
This commit is contained in:
@@ -104,6 +104,12 @@ pub enum Remote {
|
|||||||
None,
|
None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Remote {
|
||||||
|
pub fn is_none(&self) -> bool {
|
||||||
|
matches!(self, Self::None)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Bookmark parameters
|
/// Bookmark parameters
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct BookmarkParams {
|
pub struct BookmarkParams {
|
||||||
|
|||||||
+8
-2
@@ -87,11 +87,17 @@ fn parse_args(args: Args) -> Result<RunOpts, String> {
|
|||||||
Ok(remote) => {
|
Ok(remote) => {
|
||||||
// Set params
|
// Set params
|
||||||
run_opts.remote = remote;
|
run_opts.remote = remote;
|
||||||
// In this case the first activity will be FileTransfer
|
|
||||||
run_opts.task = Task::Activity(NextActivity::FileTransfer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set activity based on remote state
|
||||||
|
run_opts.task =
|
||||||
|
if run_opts.remote.remote.is_none() || run_opts.remote.host_bridge.is_none() {
|
||||||
|
Task::Activity(NextActivity::Authentication)
|
||||||
|
} else {
|
||||||
|
Task::Activity(NextActivity::FileTransfer)
|
||||||
|
};
|
||||||
|
|
||||||
// Local directory
|
// Local directory
|
||||||
if let Some(localdir) = run_opts.remote.local_dir.as_deref() {
|
if let Some(localdir) = run_opts.remote.local_dir.as_deref() {
|
||||||
if let Err(err) = env::set_current_dir(localdir) {
|
if let Err(err) = env::set_current_dir(localdir) {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ impl AuthActivity {
|
|||||||
self.save_recent();
|
self.save_recent();
|
||||||
// Set file transfer params to context
|
// Set file transfer params to context
|
||||||
self.context_mut().set_remote_params(params);
|
self.context_mut().set_remote_params(params);
|
||||||
|
// TODO: set host bridge params
|
||||||
// Set exit reason
|
// Set exit reason
|
||||||
self.exit_reason = Some(super::ExitReason::Connect);
|
self.exit_reason = Some(super::ExitReason::Connect);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user