Commit 14f68be 1 parent 0df82be commit 14f68be Copy full SHA for 14f68be
File tree 3 files changed +13
-6
lines changed
3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,3 @@ With `stack exec -- gitallup-exe --help` to see this text:
26
26
updating, comma separated
27
27
-v,--verbose Verbose output?
28
28
~~~~
29
-
30
- ## Run tests
31
-
32
- `stack test`
Original file line number Diff line number Diff line change
1
+ cradle :
2
+ stack:
Original file line number Diff line number Diff line change 11
11
12
12
import qualified Data.ByteString.Lazy as B
13
13
import qualified Data.ByteString.Lazy.Char8 as C8
14
- import RIO
14
+
15
+ import RIO ( ExitCode
16
+ ( ExitFailure
17
+ , ExitSuccess
18
+ )
19
+ , RIO
20
+ )
15
21
import RIO.Process ( proc
16
22
, readProcess
17
23
)
@@ -42,9 +48,12 @@ gitResetHard branch =
42
48
>>= _processResult
43
49
44
50
isMasterBranch :: B. ByteString -> Bool
45
- isMasterBranch s = " * master " `elem` branches
51
+ isMasterBranch s = any ( `elem` _masterBranches) branches
46
52
where branches = lines . C8. unpack $ s
47
53
48
54
_processResult :: ReadProcessResult -> RIO App ()
49
55
_processResult (ExitSuccess , out, _ ) = logSuc (C8. unpack out)
50
56
_processResult (ExitFailure code, _ , err) = logErr code (C8. unpack err)
57
+
58
+ _masterBranches :: [String ]
59
+ _masterBranches = [" * master" , " * main" ]
You can’t perform that action at this time.
0 commit comments