|
|
@ -15,9 +15,7 @@
|
|
|
|
package genutil
|
|
|
|
package genutil
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"github.com/OpenIMSDK/tools/errs"
|
|
|
|
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"path/filepath"
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -43,9 +41,6 @@ func OutDir(path string) (string, error) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func ExitWithError(err error) {
|
|
|
|
func ExitWithError(err error) {
|
|
|
|
if errors.Is(errs.Unwrap(err), errors.New("SIGTERM EXIT")) {
|
|
|
|
|
|
|
|
os.Exit(-1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
progName := filepath.Base(os.Args[0])
|
|
|
|
progName := filepath.Base(os.Args[0])
|
|
|
|
fmt.Fprintf(os.Stderr, "\n\n%s exit -1: \n%+v\n\n", progName, err)
|
|
|
|
fmt.Fprintf(os.Stderr, "\n\n%s exit -1: \n%+v\n\n", progName, err)
|
|
|
|
os.Exit(-1)
|
|
|
|
os.Exit(-1)
|
|
|
|