Skip to content

Commit

Permalink
Merge pull request #110 from mihaigalos/fix/interactive-mode
Browse files Browse the repository at this point in the history
Fix interactive mode
  • Loading branch information
mihaigalos authored Aug 10, 2022
2 parents 2166f07 + be0ebcc commit 5afb491
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ strfmt = "0.2.1"
tokio = { version = "1.20.1", features = ["full"] }
tokio-util = {version="0.7.3", features = ["full"]}
untildify = "0.1.1"
url-parse = "0.5.6"
url-parse = "0.5.7"
uuid = { version = "1.1", features = ["v4"] }
warpy = "0.2.5"

Expand Down
20 changes: 10 additions & 10 deletions src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub struct Options {
}

use url_parse::core::Parser;
use url_parse::utils::Utils;

use futures_util::FutureExt;

Expand Down Expand Up @@ -143,14 +144,8 @@ impl Driver {
}

pub async fn dispatch(input: &str, output: &str, options: &Options) -> io::Result<()> {
let path = &Self::navigate(input, options).await;
Driver::drive(
&(input.to_string() + "/" + path),
output,
options.silent,
&options.expected_sha256,
)
.await
let input = &Self::navigate(input, options).await;
Driver::drive(input, output, options.silent, &options.expected_sha256).await
}

async fn drive(
Expand Down Expand Up @@ -187,9 +182,14 @@ impl Driver {
false => "".to_string(),
true => Navi::run(input, crate::https::HTTPSHandler::get_links)
.await
.unwrap_or("".to_string()),
.unwrap_or("".to_string() + "/"),
};
path

if path != "" {
let parser = Parser::new(None);
return Utils::canonicalize(&parser, input, &path);
}
input.to_string()
}
}

Expand Down

0 comments on commit 5afb491

Please sign in to comment.