File tree Expand file tree Collapse file tree 2 files changed +5
-117
lines changed Expand file tree Collapse file tree 2 files changed +5
-117
lines changed Load Diff This file was deleted. 
Original file line number Diff line number Diff line change @@ -4,54 +4,29 @@ import (
44	"context" 
55	"errors" 
66	"fmt" 
7- 	"os" 
87
98	starportcmd "github.com/tendermint/starport/starport/cmd" 
109	"github.com/tendermint/starport/starport/pkg/clictx" 
11- 	"github.com/tendermint/starport/starport/pkg/gacli" 
1210	"github.com/tendermint/starport/starport/pkg/validation" 
1311)
1412
1513func  main () {
16- 	defer  func () {
17- 		if  r  :=  recover (); r  !=  nil  {
18- 			addMetric (Metric {
19- 				Err : fmt .Errorf ("%v" , r ),
20- 			})
21- 			fmt .Println (r )
22- 			os .Exit (1 )
23- 		}
24- 	}()
25- 	gaclient  =  gacli .New (gaid )
26- 	name , hadLogin  :=  prepLoginName ()
27- 	if  ! hadLogin  {
28- 		addMetric (Metric {
29- 			Login :          name ,
30- 			IsInstallation : true ,
31- 		})
32- 	}
33- 	// if running serve command, don't wait sending metric until the end of 
34- 	// execution because it takes a long time. 
35- 	if  len (os .Args ) >  1  &&  os .Args [1 ] ==  "serve"  {
36- 		addMetric (Metric {})
37- 	}
38- 
3914	ctx  :=  clictx .From (context .Background ())
15+ 
4016	err  :=  starportcmd .New ().ExecuteContext (ctx )
4117
4218	if  err  ==  context .Canceled  {
43- 		addMetric (Metric {
44- 			Err : err ,
45- 		})
4619		fmt .Println ("aborted" )
4720		return 
4821	}
22+ 
4923	if  err  !=  nil  {
5024		var  validationErr  validation.Error 
25+ 
5126		if  errors .As (err , & validationErr ) {
5227			panic (validationErr .ValidationInfo ())
53- 		} else  {
54- 			panic (err )
5528		}
29+ 
30+ 		panic (err )
5631	}
5732}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments