File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package main
22
33import (
4- "os"
5-
64 "github.com/smallstep/certificates/ca"
75 "github.com/smallstep/cli-utils/step"
86
@@ -27,5 +25,5 @@ func init() {
2725}
2826
2927func main () {
30- os . Exit ( cmd .Run () )
28+ cmd .Run ()
3129}
Original file line number Diff line number Diff line change 11package integration
22
33import (
4- "os"
54 "testing"
65
76 "github.com/rogpeppe/go-internal/testscript"
@@ -10,7 +9,7 @@ import (
109)
1110
1211func TestMain (m * testing.M ) {
13- os . Exit ( testscript .RunMain (m , map [string ]func () int {
12+ testscript .Main (m , map [string ]func (){
1413 "step" : cmd .Run , // main entrypoint name
15- }))
14+ })
1615}
Original file line number Diff line number Diff line change @@ -43,15 +43,19 @@ import (
4343 _ "github.com/smallstep/cli/command/ssh"
4444)
4545
46- func Run () int {
46+ func Run () {
47+ os .Exit (run ())
48+ }
49+
50+ func run () int {
51+ defer panicHandler ()
52+
4753 // initialize step environment.
4854 if err := step .Init (); err != nil {
4955 fmt .Fprintln (os .Stderr , err .Error ())
5056 return 1
5157 }
5258
53- defer panicHandler ()
54-
5559 // create new instance of app
5660 app := newApp (os .Stdout , os .Stderr )
5761
You can’t perform that action at this time.
0 commit comments