Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion commands/devnet/spawn_rpc.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package devnet

import (
"fmt"
"os"

"github.com/pkg/errors"
Expand All @@ -16,6 +17,7 @@ var projectSlug string
var templateSlug string
var accessKey string
var token string
var returnUrl bool

func init() {
cmdSpawnRpc.PersistentFlags().StringVar(
Expand Down Expand Up @@ -48,6 +50,12 @@ func init() {
"",
"The Tenderly JWT. If not provided, the system will try to read 'token' from the 'tenderly.yaml' configuration file.",
)
cmdSpawnRpc.PersistentFlags().BoolVar(
&returnUrl,
"return-url",
false,
"Optional flag to return the URL instead of printing it. Default: false.",
)
CmdDevNet.AddCommand(cmdSpawnRpc)
}

Expand Down Expand Up @@ -118,5 +126,10 @@ func spawnRPCHandler(cmd *cobra.Command, args []string) {
logrus.Error("Failed to spawn RPC", err)
return
}
logrus.Info(response)

if returnUrl {
fmt.Printf("%s\n", response)
} else {
logrus.Info(response)
}
}