@@ -5,10 +5,8 @@ import (
5
5
"errors"
6
6
"fmt"
7
7
"os"
8
- "os/signal"
9
8
"regexp"
10
9
"strings"
11
- "syscall"
12
10
13
11
"github.com/cli/go-gh/v2/pkg/api"
14
12
"github.com/spf13/cobra"
@@ -120,7 +118,7 @@ func Run() error {
120
118
121
119
// runCombine is the main execution function for the combine command
122
120
func runCombine (cmd * cobra.Command , args []string ) error {
123
- ctx , cancel := setupSignalContext ()
121
+ ctx , cancel := SetupSignalContext ()
124
122
defer cancel ()
125
123
126
124
Logger .Debug ("starting gh-combine" , "version" , version .String ())
@@ -151,25 +149,6 @@ func runCombine(cmd *cobra.Command, args []string) error {
151
149
return nil
152
150
}
153
151
154
- // setupSignalContext creates a context that's cancelled on SIGINT or SIGTERM
155
- func setupSignalContext () (context.Context , context.CancelFunc ) {
156
- ctx , cancel := context .WithCancel (context .Background ())
157
- signalChan := make (chan os.Signal , 1 )
158
- signal .Notify (signalChan , os .Interrupt , syscall .SIGTERM )
159
-
160
- go func () {
161
- select {
162
- case <- signalChan :
163
- Logger .Debug ("Received interrupt signal, cancelling operations..." )
164
- cancel ()
165
- case <- ctx .Done ():
166
- }
167
- signal .Stop (signalChan )
168
- }()
169
-
170
- return ctx , cancel
171
- }
172
-
173
152
// parseRepositories parses repository names from arguments or file
174
153
func parseRepositories (args []string ) ([]string , error ) {
175
154
var repos []string
0 commit comments