From a8f1ec74fa3d24154673dbefdbbb6787567bcaf1 Mon Sep 17 00:00:00 2001 From: Nate Meyer <672246+notnmeyer@users.noreply.github.com> Date: Thu, 18 Jun 2026 09:36:50 -0700 Subject: [PATCH 1/4] show version after installation --- install.ps1 | 1 + install.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/install.ps1 b/install.ps1 index 25bea4c..84ed060 100644 --- a/install.ps1 +++ b/install.ps1 @@ -81,3 +81,4 @@ try { Write-Host "Done!" Write-Host "Installed to $InstallDir\$BinName" +& "$InstallDir\$BinName" --version diff --git a/install.sh b/install.sh index c75145d..dbc1bdb 100755 --- a/install.sh +++ b/install.sh @@ -248,3 +248,4 @@ echo "Installing ${PROJ_NAME} $GH_RELEASE for $OS $ARCH... " execute echo "Done!" echo "Installed to ${INSTALL_DIR}/${SHORT_BIN_NAME}" +"${INSTALL_DIR}/${SHORT_BIN_NAME}" --version From cc4c169fe7b0b9ab6c97d88da21d7523d457209d Mon Sep 17 00:00:00 2001 From: Nate Meyer <672246+notnmeyer@users.noreply.github.com> Date: Thu, 18 Jun 2026 09:38:12 -0700 Subject: [PATCH 2/4] compact installation messaging --- install.ps1 | 3 ++- install.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/install.ps1 b/install.ps1 index 84ed060..7bfff47 100644 --- a/install.ps1 +++ b/install.ps1 @@ -50,7 +50,7 @@ $checksumsName = "${ProjName}_${versionNoV}_checksums.txt" $downloadUrl = "$GHAssetsUrl/$release/$archiveName" $checksumsUrl = "$GHAssetsUrl/$release/$checksumsName" -Write-Host "Installing $ProjName $release for windows/$Arch..." +Write-Host "Installing $ProjName $release for windows/$Arch... " -NoNewline $tmpDir = Join-Path $env:TEMP ([System.IO.Path]::GetRandomFileName()) New-Item -ItemType Directory -Path $tmpDir | Out-Null @@ -80,5 +80,6 @@ try { } Write-Host "Done!" +Write-Host "✓ " -ForegroundColor Green -NoNewline Write-Host "Installed to $InstallDir\$BinName" & "$InstallDir\$BinName" --version diff --git a/install.sh b/install.sh index dbc1bdb..2e4664b 100755 --- a/install.sh +++ b/install.sh @@ -244,8 +244,8 @@ execute() { rm -rf "$TMPDIR" } -echo "Installing ${PROJ_NAME} $GH_RELEASE for $OS $ARCH... " +printf "Installing %s %s for %s %s... " "$PROJ_NAME" "$GH_RELEASE" "$OS" "$ARCH" execute echo "Done!" -echo "Installed to ${INSTALL_DIR}/${SHORT_BIN_NAME}" +printf '\033[32m✓\033[0m Installed to %s\n' "${INSTALL_DIR}/${SHORT_BIN_NAME}" "${INSTALL_DIR}/${SHORT_BIN_NAME}" --version From 6be8a6ab709afb44e6ce8160a8ef50252e5b3099 Mon Sep 17 00:00:00 2001 From: Nate Meyer <672246+notnmeyer@users.noreply.github.com> Date: Thu, 18 Jun 2026 09:51:48 -0700 Subject: [PATCH 3/4] try loops --help --- install.ps1 | 2 ++ install.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/install.ps1 b/install.ps1 index 7bfff47..39a4464 100644 --- a/install.ps1 +++ b/install.ps1 @@ -83,3 +83,5 @@ Write-Host "Done!" Write-Host "✓ " -ForegroundColor Green -NoNewline Write-Host "Installed to $InstallDir\$BinName" & "$InstallDir\$BinName" --version +Write-Host "" +Write-Host 'Try `loops --help` to get started.' -ForegroundColor DarkGray diff --git a/install.sh b/install.sh index 2e4664b..14f69c9 100755 --- a/install.sh +++ b/install.sh @@ -249,3 +249,5 @@ execute echo "Done!" printf '\033[32m✓\033[0m Installed to %s\n' "${INSTALL_DIR}/${SHORT_BIN_NAME}" "${INSTALL_DIR}/${SHORT_BIN_NAME}" --version +echo "" +printf '\033[2mTry `%s --help` to get started.\033[0m\n' "$SHORT_BIN_NAME" From ec6e8d106522e2406d8b9b32eadfee7987166c58 Mon Sep 17 00:00:00 2001 From: Nate Meyer <672246+notnmeyer@users.noreply.github.com> Date: Thu, 18 Jun 2026 10:17:46 -0700 Subject: [PATCH 4/4] include sdk version in version output --- cmd/build_info.go | 38 +++++++++++++++++++++++++++++--------- cmd/root.go | 1 - 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/cmd/build_info.go b/cmd/build_info.go index 08425f4..f94e1db 100644 --- a/cmd/build_info.go +++ b/cmd/build_info.go @@ -6,8 +6,9 @@ import ( ) var ( - version = "dev" - commit = "none" + version = "dev" + commit = "none" + sdkVersion = "" ) // includes a leading newline to make it easy to read the ascii art here in the source @@ -20,17 +21,36 @@ const versionHeader = ` ` func init() { - if info, ok := debug.ReadBuildInfo(); ok && version == "dev" { - if info.Main.Version != "" && info.Main.Version != "(devel)" { - version = strings.TrimPrefix(info.Main.Version, "v") + if info, ok := debug.ReadBuildInfo(); ok { + if version == "dev" { + if info.Main.Version != "" && info.Main.Version != "(devel)" { + version = info.Main.Version + } + for _, s := range info.Settings { + if s.Key == "vcs.revision" && len(s.Value) >= 7 { + commit = s.Value[:7] + break + } + } } - for _, s := range info.Settings { - if s.Key == "vcs.revision" && len(s.Value) >= 7 { - commit = s.Value[:7] + for _, dep := range info.Deps { + if dep.Path == "github.com/loops-so/loops-go" { + sdkVersion = dep.Version break } } } header := strings.TrimPrefix(versionHeader, "\n") - rootCmd.SetVersionTemplate(header + "\n{{with .Name}}{{printf \"%s \" .}}{{end}}{{printf \"version %s\" .Version}}\n") + parts := []string{} + if commit != "" && commit != "none" { + parts = append(parts, "git "+commit) + } + if sdkVersion != "" { + parts = append(parts, "sdk "+sdkVersion) + } + suffix := "" + if len(parts) > 0 { + suffix = " (" + strings.Join(parts, ", ") + ")" + } + rootCmd.SetVersionTemplate(header + "\n{{with .Name}}{{printf \"%s \" .}}{{end}}{{printf \"version %s\" .Version}}" + suffix + "\n") } diff --git a/cmd/root.go b/cmd/root.go index 39fe8cf..d908833 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -75,7 +75,6 @@ func Execute() { context.Background(), rootCmd, fang.WithVersion(version), - fang.WithCommit(commit), fang.WithErrorHandler(jsonAwareErrorHandler), )