@@ -5,39 +5,41 @@ const { execSync } = require("child_process");
5
5
const TextInput = require ( "ink-text-input" ) . default ;
6
6
7
7
const DeleteTab = ( props ) => {
8
- //Uses git branch and displays all local branches
9
- //Takes in an input to for delete branch
8
+ //Uses git branch and displays all local branches
9
+ //Takes in an input to for delete branch
10
10
11
- const [ del , setDelete ] = useState ( '' )
11
+ const [ del , setDelete ] = useState ( "" ) ;
12
12
13
- let { refreshTab } = props
13
+ let { refreshTab } = props ;
14
14
15
- let branchList = execSync ( ' git branch' ) . toString ( ) . split ( '\n' )
16
- let branches = branchList
15
+ let branchList = execSync ( " git branch" ) . toString ( ) . split ( "\n" ) ;
16
+ let branches = branchList ;
17
17
18
- const handleSubmit = ( ) => {
18
+ const handleSubmit = ( ) => {
19
19
try {
20
- execSync ( ' git branch -D ' + del + '' )
21
- refreshTab ( '' )
20
+ execSync ( " git branch -D " + del + "" ) ;
21
+ refreshTab ( "" ) ;
22
22
} catch ( error ) { }
23
- }
24
- return (
25
- < Box flexDirection = 'column' >
26
- < Box > < Text > </ Text > </ Box >
27
- < Box >
28
- < Text color = 'red' > Branches: </ Text >
29
- < Text > { branches } </ Text >
30
- </ Box >
31
- < Box >
32
- < Box >
33
- < Text color = 'red' > Delete Branch: </ Text >
34
- < TextInput value = { del } onChange = { setDelete } onSubmit = { handleSubmit } />
35
- </ Box >
36
- </ Box >
37
- < Newline />
38
- < Text color = 'gray' > Press ESC to go back </ Text >
39
- </ Box >
40
- )
41
- }
23
+ } ;
24
+ return (
25
+ < Box flexDirection = "column" >
26
+ < Box >
27
+ < Text > </ Text >
28
+ </ Box >
29
+ < Box >
30
+ < Text color = "red" > Branches: </ Text >
31
+ < Text > { branches . join ( " " ) } </ Text >
32
+ </ Box >
33
+ < Box >
34
+ < Box >
35
+ < Text color = "red" > Delete Branch: </ Text >
36
+ < TextInput value = { del } onChange = { setDelete } onSubmit = { handleSubmit } />
37
+ </ Box >
38
+ </ Box >
39
+ < Newline />
40
+ < Text color = "gray" > Press ESC to go back </ Text >
41
+ </ Box >
42
+ ) ;
43
+ } ;
42
44
43
- module . exports = DeleteTab
45
+ module . exports = DeleteTab ;
0 commit comments