File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
dev/preview/previewctl/cmd Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ func newGetCmd(logger *logrus.Logger) *cobra.Command {
28
28
cmd .AddCommand (
29
29
newGetNameSubCmd (),
30
30
newGetActiveCmd (logger ),
31
+ newGetUrlSubCmd (),
31
32
)
32
33
33
34
return cmd
@@ -52,6 +53,26 @@ func newGetNameSubCmd() *cobra.Command {
52
53
return cmd
53
54
}
54
55
56
+ func newGetUrlSubCmd () * cobra.Command {
57
+ cmd := & cobra.Command {
58
+ Use : "url" ,
59
+ Short : "" ,
60
+ RunE : func (cmd * cobra.Command , args []string ) error {
61
+ previewName , err := preview .GetName (branch )
62
+ if err != nil {
63
+ return err
64
+ }
65
+
66
+ previewUrl := fmt .Sprintf ("https://%s.preview.gitpod-dev.com" , previewName )
67
+ fmt .Println (previewUrl )
68
+
69
+ return nil
70
+ },
71
+ }
72
+
73
+ return cmd
74
+ }
75
+
55
76
func newGetActiveCmd (logger * logrus.Logger ) * cobra.Command {
56
77
ctx := context .Background ()
57
78
You can’t perform that action at this time.
0 commit comments