Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#5 - compensate for the escape sequence that is sent at the start of … #6

Merged
merged 1 commit into from
Nov 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/sdkman/candidate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mod private {
let mut equals = 0;
let mut version_table: Vec<Vec<String>> = Vec::new();
let lines = self.output.lines();
let equals_pattern = Regex::new("^=+$").unwrap();
let equals_pattern = Regex::new("^(\\x1b.*)?={5,}$").unwrap();
for line in lines {
if equals_pattern.is_match(line) {
equals += 1;
Expand All @@ -48,7 +48,7 @@ mod private {
let mut dashes = 0;
let lines = self.output.lines();
let mut versions: Vec<String> = Vec::new();
let equals_pattern = Regex::new("^=+$").unwrap();
let equals_pattern = Regex::new("^(\\x1b.*)?={5,}$").unwrap();
let dashes_pattern = Regex::new("^-+$").unwrap();
for line in lines {
if equals_pattern.is_match(line) {
Expand Down Expand Up @@ -90,7 +90,7 @@ mod test {
let candidate = SdkManCandidate {
name: "kotlin".to_string(),
output: "
================================================================================
\x1b]1================================================================================
Available Kotlin Versions
================================================================================
> * 1.9.0 1.4.20 1.2.70 1.1.4
Expand Down
Loading