From dbf0962dc12f05122d1499b095c8bd1c6c2d2a8e Mon Sep 17 00:00:00 2001 From: javaducky Date: Thu, 17 Mar 2022 09:10:27 -0500 Subject: [PATCH 1/2] Provide an end-of-build message Addresses issue #38 --- cmd/xk6/main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/xk6/main.go b/cmd/xk6/main.go index 1a0f697..c6ada52 100644 --- a/cmd/xk6/main.go +++ b/cmd/xk6/main.go @@ -160,6 +160,15 @@ func runBuild(ctx context.Context, args []string) error { } } + fmt.Println("***************************************************") + fmt.Println("* BUILD COMPLETE - FOLLOW THESE STEPS TO CONTINUE *") + fmt.Println("***************************************************") + fmt.Println("xk6 has now produced a new k6 binary with the following:") + for _, extension := range extensions { + fmt.Println(" -", extension.PackagePath) + } + fmt.Printf("To use it, call it directly as `%v run `.\n", output) + return nil } From b18f9ed94ac261d22f8754594d90738e88c187fa Mon Sep 17 00:00:00 2001 From: javaducky Date: Fri, 18 Mar 2022 07:49:52 -0500 Subject: [PATCH 2/2] Simplifying the end of build message. Turns out the summary is a slippery slope! --- cmd/xk6/main.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/xk6/main.go b/cmd/xk6/main.go index c6ada52..57b5a99 100644 --- a/cmd/xk6/main.go +++ b/cmd/xk6/main.go @@ -56,6 +56,7 @@ func main() { func runBuild(ctx context.Context, args []string) error { // parse the command line args... rather primitively var argK6Version, output string + var outputOverride bool var extensions []xk6.Dependency var replacements []xk6.Replace for i := 0; i < len(args); i++ { @@ -108,6 +109,7 @@ func runBuild(ctx context.Context, args []string) error { } i++ output = args[i] + outputOverride = true default: if argK6Version != "" { @@ -160,14 +162,12 @@ func runBuild(ctx context.Context, args []string) error { } } - fmt.Println("***************************************************") - fmt.Println("* BUILD COMPLETE - FOLLOW THESE STEPS TO CONTINUE *") - fmt.Println("***************************************************") - fmt.Println("xk6 has now produced a new k6 binary with the following:") - for _, extension := range extensions { - fmt.Println(" -", extension.PackagePath) + if !outputOverride { + path, _ := os.Getwd() + fmt.Println() + fmt.Println("xk6 has now produced a new k6 binary which may be different than the command on your system path!") + fmt.Printf("Be sure to run '%v run ' from the '%v' directory.\n", output, path) } - fmt.Printf("To use it, call it directly as `%v run `.\n", output) return nil }