Skip to content

Commit

Permalink
#5 - compensate for the escape sequence that is sent at the start of …
Browse files Browse the repository at this point in the history
…sdk list commands
  • Loading branch information
GJKrupa committed Nov 26, 2023
1 parent 8dc54d7 commit 36f97d4
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 36f97d4

Please sign in to comment.