mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-12 19:10:35 +00:00
fix: listen for device flow completion without requiring enter
This commit is contained in:
parent
051e062c39
commit
14aeabeed2
2 changed files with 16 additions and 12 deletions
|
@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Fixed
|
### Fixed
|
||||||
- Use updated aliases when reusing lockfile dependencies by @daimond113
|
- Use updated aliases when reusing lockfile dependencies by @daimond113
|
||||||
|
- Listen for device flow completion without requiring pressing enter by @daimond113
|
||||||
|
|
||||||
## [0.5.0-rc.6] - 2024-10-14
|
## [0.5.0-rc.6] - 2024-10-14
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -2,6 +2,7 @@ use anyhow::Context;
|
||||||
use clap::Args;
|
use clap::Args;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
use std::thread::spawn;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use pesde::{
|
use pesde::{
|
||||||
|
@ -81,11 +82,12 @@ impl LoginCommand {
|
||||||
response.verification_uri.as_str().blue()
|
response.verification_uri.as_str().blue()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
spawn(move || {
|
||||||
{
|
{
|
||||||
let mut input = String::new();
|
let mut input = String::new();
|
||||||
std::io::stdin()
|
std::io::stdin()
|
||||||
.read_line(&mut input)
|
.read_line(&mut input)
|
||||||
.context("failed to read input")?;
|
.expect("failed to read input");
|
||||||
}
|
}
|
||||||
|
|
||||||
match open::that(response.verification_uri.as_str()) {
|
match open::that(response.verification_uri.as_str()) {
|
||||||
|
@ -94,6 +96,7 @@ impl LoginCommand {
|
||||||
eprintln!("failed to open browser: {e}");
|
eprintln!("failed to open browser: {e}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let mut time_left = response.expires_in;
|
let mut time_left = response.expires_in;
|
||||||
let mut interval = std::time::Duration::from_secs(response.interval);
|
let mut interval = std::time::Duration::from_secs(response.interval);
|
||||||
|
|
Loading…
Reference in a new issue