From c00f1b1c47215b36e32571999dce5963b0f5e9ac Mon Sep 17 00:00:00 2001 From: Nasfame Date: Wed, 3 Jan 2024 00:01:07 +0530 Subject: [PATCH 1/5] display: version fixes --- Makefile | 7 +++++-- cmd/lilypad/root.go | 3 ++- main.go | 4 +--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4b91368b..fba3a1e6 100644 --- a/Makefile +++ b/Makefile @@ -2,5 +2,8 @@ release: go build -v -ldflags="\ -X 'github.com/bacalhau-project/lilypad/cmd/lilypad.VERSION=$$(git describe --tags --abbrev=0)' \ -X 'github.com/bacalhau-project/lilypad/cmd/lilypad.COMMIT_SHA=$$(git rev-parse HEAD)' \ - " . - ./lilypad version \ No newline at end of file + " -o bin/ + ./bin/lilypad version + + + diff --git a/cmd/lilypad/root.go b/cmd/lilypad/root.go index e1a65d75..b6ea4402 100644 --- a/cmd/lilypad/root.go +++ b/cmd/lilypad/root.go @@ -2,6 +2,7 @@ package lilypad import ( "context" + "fmt" "os" "github.com/spf13/cobra" @@ -17,7 +18,7 @@ func NewRootCmd() *cobra.Command { RootCmd := &cobra.Command{ Use: getCommandLineExecutable(), Short: "Lilypad", - Long: `Lilypad`, + Long: fmt.Sprintf("Lilypad: %s \n Commit: %s \n", VERSION, COMMIT_SHA), } RootCmd.AddCommand(newSolverCmd()) RootCmd.AddCommand(newResourceProviderCmd()) diff --git a/main.go b/main.go index a16ef196..6c03f29d 100644 --- a/main.go +++ b/main.go @@ -1,8 +1,6 @@ package main import ( - "fmt" - "github.com/bacalhau-project/lilypad/cmd/lilypad" ) @@ -11,5 +9,5 @@ func main() { } func init() { - fmt.Printf("Lilypad: %s\n", lilypad.VERSION) + //fmt.Printf("Lilypad: %s\n", lilypad.VERSION) } From 051e2157b6dc38adb181a23276a1f6f3fef957f3 Mon Sep 17 00:00:00 2001 From: Nasfame Date: Wed, 3 Jan 2024 00:44:58 +0530 Subject: [PATCH 2/5] update scripts --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index fba3a1e6..8fbc6847 100644 --- a/Makefile +++ b/Makefile @@ -7,3 +7,8 @@ release: +.PHONY: release install + +install-windows: + make release + cp ./bin/lilypad.exe $env:GOBIN From 69c0459c6ae07966fc4695bc396adaef28ffb9ff Mon Sep 17 00:00:00 2001 From: Nasfame Date: Wed, 3 Jan 2024 01:00:36 +0530 Subject: [PATCH 3/5] scripts: fixes --- Makefile | 3 ++- cmd/lilypad/root.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8fbc6847..0e546622 100644 --- a/Makefile +++ b/Makefile @@ -11,4 +11,5 @@ release: install-windows: make release - cp ./bin/lilypad.exe $env:GOBIN + cp ./bin/lilypad.exe $$GOBIN +#Ps1: cmd cp ./bin/lilypad.exe $env:GOBIN diff --git a/cmd/lilypad/root.go b/cmd/lilypad/root.go index b6ea4402..92021acf 100644 --- a/cmd/lilypad/root.go +++ b/cmd/lilypad/root.go @@ -18,7 +18,7 @@ func NewRootCmd() *cobra.Command { RootCmd := &cobra.Command{ Use: getCommandLineExecutable(), Short: "Lilypad", - Long: fmt.Sprintf("Lilypad: %s \n Commit: %s \n", VERSION, COMMIT_SHA), + Long: fmt.Sprintf("Lilypad: %s \nCommit: %s \n", VERSION, COMMIT_SHA), } RootCmd.AddCommand(newSolverCmd()) RootCmd.AddCommand(newResourceProviderCmd()) From 2713da46f6e125aa53e4d597737f365fb992fb1b Mon Sep 17 00:00:00 2001 From: Nasfame Date: Wed, 3 Jan 2024 01:10:28 +0530 Subject: [PATCH 4/5] display: version in the go --- cmd/lilypad/root.go | 7 ++++--- cmd/lilypad/run.go | 10 ++++++++-- cmd/lilypad/version.go | 6 ++++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/cmd/lilypad/root.go b/cmd/lilypad/root.go index 92021acf..c9417068 100644 --- a/cmd/lilypad/root.go +++ b/cmd/lilypad/root.go @@ -10,9 +10,10 @@ import ( var Fatal = FatalErrorHandler -func init() { //nolint:gochecknoinits - NewRootCmd() -} +//FIXME: why @Kai? +//func init() { //nolint:gochecknoinits +// NewRootCmd() +//} func NewRootCmd() *cobra.Command { RootCmd := &cobra.Command{ diff --git a/cmd/lilypad/run.go b/cmd/lilypad/run.go index 0c1fda35..d91a8395 100644 --- a/cmd/lilypad/run.go +++ b/cmd/lilypad/run.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "os/signal" + "strings" "syscall" "time" @@ -41,7 +42,7 @@ func newRunCmd() *cobra.Command { func runJob(cmd *cobra.Command, options jobcreator.JobCreatorOptions) error { c := color.New(color.FgCyan).Add(color.Bold) - c.Print(` + header := ` ⠀⠀⠀⠀⠀⠀⣀⣤⣤⢠⣤⣀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⢴⣿⣿⣿⣿⢸⣿⡟⠀⠀⠀⠀⠀ ██╗ ██╗██╗ ██╗ ██╗██████╗ █████╗ ██████╗ ⠀⠀⣰⣿⣦⡙⢿⣿⣿⢸⡿⠀⠀⠀⠀⢀⠀ ██║ ██║██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ @@ -52,7 +53,12 @@ func runJob(cmd *cobra.Command, options jobcreator.JobCreatorOptions) error { ⠀⠀⠀⠉⢾⣿⣿⣿⣿⢸⣿⣿⣿⡷⠈⠀⠀ ⠀⠀⠀⠀⠀⠈⠙⠛⠛⠘⠛⠋⠁⠀ ⠀⠀⠀ Decentralized Compute Network https://lilypad.tech -`) +` + if VERSION != "" { + header = strings.Replace(header, "v2", VERSION, 1) + } + c.Print(header) + spinner, err := createSpinner("Lilypad submitting job", "🌟") if err != nil { fmt.Printf("failed to make spinner from config struct: %v\n", err) diff --git a/cmd/lilypad/version.go b/cmd/lilypad/version.go index 3ac30c22..176bfb8d 100644 --- a/cmd/lilypad/version.go +++ b/cmd/lilypad/version.go @@ -50,3 +50,9 @@ func runVersion(cmd *cobra.Command) error { return nil } + +//func init() { +// if VERSION == "" { +// VERSION = "v2" //TODO: @release, FIX: L41 +// } +//} From 685b82d393d532d01086937868f3e71a299ef3c2 Mon Sep 17 00:00:00 2001 From: Nasfame Date: Wed, 3 Jan 2024 01:14:05 +0530 Subject: [PATCH 5/5] install: --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0e546622..6b6a7e26 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ release: .PHONY: release install -install-windows: +install: make release cp ./bin/lilypad.exe $$GOBIN #Ps1: cmd cp ./bin/lilypad.exe $env:GOBIN