Skip to content

Commit 8057f40

Browse files
committed
feat: change wording & support Version buildtime
1 parent f32174f commit 8057f40

File tree

5 files changed

+10
-44
lines changed

5 files changed

+10
-44
lines changed

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ GO_VERSION=1.22
44
GO_SYSTEM_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1-2)
55
REQUIRE_GO_VERSION = $(GO_VERSION)
66

7+
WEAVE_VERSION=v0.0.1
8+
79
BUILDDIR ?= $(CURDIR)/build
810
BUILD_TARGETS = build
911

@@ -20,7 +22,7 @@ $(BUILD_TARGETS): check_version go.sum $(BUILDDIR)/
2022
ifeq ($(OS),Windows_NT)
2123
exit 1
2224
else
23-
go $@ -mod=readonly .
25+
go $@ -mod=readonly -ldflags "-X github.com/initia-labs/weave/cmd.Version=$(WEAVE_VERSION)" .
2426
endif
2527

2628
$(BUILDDIR)/:

cmd/init.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import (
1212
func InitCommand() *cobra.Command {
1313
initCmd := &cobra.Command{
1414
Use: "init",
15-
Short: "Init for initializing the weave CLI.",
16-
Long: "Init for initializing the weave CLI.",
15+
Short: "Initialize Weave CLI, funding gas station and setting up config.",
1716
RunE: func(cmd *cobra.Command, args []string) error {
1817
if utils.IsFirstTimeSetup() {
1918
// Capture both the final model and the error from Run()

cmd/initia.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func InitiaCommand() *cobra.Command {
4545
func initiaInitCommand() *cobra.Command {
4646
initCmd := &cobra.Command{
4747
Use: "init",
48-
Short: "Init for initializing the initia CLI.",
48+
Short: "Bootstrap your Initia full node",
4949
RunE: func(cmd *cobra.Command, args []string) error {
5050
if utils.IsFirstTimeSetup() {
5151
// Capture both the final model and the error from Run()

cmd/minitia.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func MinitiaCommand() *cobra.Command {
2727
func minitiaLaunchCommand() *cobra.Command {
2828
launchCmd := &cobra.Command{
2929
Use: "launch",
30-
Short: "Launch for initializing a new L2 node.",
30+
Short: "Launch a new Minitia from scratch",
3131
RunE: func(cmd *cobra.Command, args []string) error {
3232
if utils.IsFirstTimeSetup() {
3333
// Capture both the final model and the error from Run()

cmd/root.go

+4-39
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,16 @@ package cmd
33
import (
44
"context"
55

6-
tea "github.com/charmbracelet/bubbletea"
76
"github.com/spf13/cobra"
8-
"github.com/spf13/viper"
9-
10-
"github.com/initia-labs/weave/models"
11-
"github.com/initia-labs/weave/utils"
127
)
138

9+
var Version string
10+
1411
func Execute() error {
1512
rootCmd := &cobra.Command{
16-
Version: "v1.0.0",
13+
Version: Version,
1714
Use: "weave",
18-
Long: "Weave is a CLI for managing Initia deployments.",
19-
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
20-
viper.AutomaticEnv()
21-
viper.SetEnvPrefix("weave")
22-
23-
if err := utils.InitializeConfig(); err != nil {
24-
return err
25-
}
26-
27-
return nil
28-
},
29-
RunE: func(cmd *cobra.Command, args []string) error {
30-
if utils.IsFirstTimeSetup() {
31-
// Capture both the final model and the error from Run()
32-
finalModel, err := tea.NewProgram(models.NewExistingAppChecker()).Run()
33-
if err != nil {
34-
return err
35-
}
36-
37-
// Check if the final model is of type WeaveAppSuccessfullyInitialized
38-
if _, ok := finalModel.(*models.WeaveAppSuccessfullyInitialized); !ok {
39-
// If the model is not of the expected type, return or handle as needed
40-
return nil
41-
}
42-
}
43-
44-
_, err := tea.NewProgram(models.NewHomepage()).Run()
45-
if err != nil {
46-
return err
47-
}
48-
49-
return nil
50-
},
15+
Long: "Weave is the CLI for managing Initia deployments.",
5116
}
5217

5318
rootCmd.AddCommand(InitCommand())

0 commit comments

Comments
 (0)