087db1de70
Since we're about to do a v3.0.0 release, let's bump the version to v3. Make this change automatically with the following command to avoid any missed items: git grep -l github.com/git-lfs/git-lfs/v2 | \ xargs sed -i -e 's!github.com/git-lfs/git-lfs/v2!github.com/git-lfs/git-lfs/v3!g'
37 lines
552 B
Go
37 lines
552 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"os/signal"
|
|
"sync"
|
|
"syscall"
|
|
|
|
"github.com/git-lfs/git-lfs/v3/commands"
|
|
)
|
|
|
|
func main() {
|
|
c := make(chan os.Signal)
|
|
signal.Notify(c, os.Interrupt, os.Kill)
|
|
|
|
var once sync.Once
|
|
|
|
go func() {
|
|
for {
|
|
sig := <-c
|
|
once.Do(commands.Cleanup)
|
|
fmt.Fprintf(os.Stderr, "\nExiting because of %q signal.\n", sig)
|
|
|
|
exitCode := 1
|
|
if sysSig, ok := sig.(syscall.Signal); ok {
|
|
exitCode = int(sysSig)
|
|
}
|
|
os.Exit(exitCode + 128)
|
|
}
|
|
}()
|
|
|
|
code := commands.Run()
|
|
once.Do(commands.Cleanup)
|
|
os.Exit(code)
|
|
}
|