Skip to content

Commit

Permalink
Better regexp for the output from TFE that misses ESC[0m and the begi…
Browse files Browse the repository at this point in the history
…nning of the line (#60)
  • Loading branch information
dex4er authored Jan 20, 2025
1 parent cfec9e8 commit b78ff4b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions run/terraform_with_progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ func terraformWithProgress(command string, args []string) error {
`|read \(data resources\)` +
`|will be read during apply`

patternRefreshing := `(?:.\[0m.\[1m)?(.*?): (Refresh)\w* st.*?(?:\r?\n|$)`
patternPreparingImport := `(?:.\[0m.\[1m)?(.*?): (Prepar)\w* imp.*?(?:\r?\n|$)`
patternStartOperation := `(?:.\[0m.\[1m)?(.*?): (Import|Read|Creat|Destr|Modif|Open|Clos)\w*ing.*?(?:\r?\n|$)`
patternStillOperation := `(?:.\[0m.\[1m)?(.*?): Still (import|read|creat|destr|modif|open|clos).*?(?:\r?\n|$)`
patternStopOperation := `(?:.\[0m.\[1m)?(.*?): (Import|Read|Creat|Destr|Modif|Open|Clos)\w* co.*?(?:\r?\n|$)`
patternRefreshing := `(?:(?:\x1b\[0m)?\x1b\[1m)?(.*?): (Refresh).*(?:\r?\n|$)`
patternPreparingImport := `(?:(?:\x1b\[0m)?\x1b\[1m)?(.*?): (Prepar)\w* imp.*?(?:\r?\n|$)`
patternStartOperation := `(?:(?:\x1b\[0m)?\x1b\[1m)?(.*?): (Import|Read|Creat|Destr|Modif|Open|Clos)\w*ing.*?(?:\r?\n|$)`
patternStillOperation := `(?:(?:\x1b\[0m)?\x1b\[1m)?(.*?): Still (import|read|creat|destr|modif|open|clos).*?(?:\r?\n|$)`
patternStopOperation := `(?:(?:\x1b\[0m)?\x1b\[1m)?(.*?): (Import|Read|Creat|Destr|Modif|Open|Clos)\w* co.*?(?:\r?\n|$)`

patternIgnoreOutputs := `^Outputs:(\n|$)`

Expand Down

0 comments on commit b78ff4b

Please sign in to comment.