Skip to content

Commit df4a1a1

Browse files
yousefissabomanimc
authored andcommitted
Fixed rocket launch animation on git error. (bomanimc#5)
Adds and anti-patterns array that checks for error cases when git fails. Fixes issue bomanimc#4.
1 parent 7518649 commit df4a1a1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/GitRocketTerminal.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ import { Rocket, RocketSpan, FinTop, FinBottom, Fire, Wastes } from './styledEle
77
// This function performs regex matching on expected shell output for git push result being input
88
// at the command line. Currently it supports output from bash, zsh, fish, cmd and powershell.
99
function detectPushCommand(data) {
10-
const patterns = [
11-
'To(.+)\.git',
12-
];
13-
return new RegExp(`(${patterns.join(')|(')})`).test(data);
10+
const patterns = ['To(.+)\.git'];
11+
const antiPatterns = ['error:'];
12+
return new RegExp(`(${patterns.join(')|(')})`).test(data) && !new RegExp(`(${antiPatterns.join(')|(')})`).test(data);
1413
}
1514

1615
exports.middleware = store => next => (action) => {

0 commit comments

Comments
 (0)