edit icon indicating copy to clipboard operation
edit copied to clipboard

edit --version leaves trailing space

Open SupSkiFun opened this issue 1 year ago • 0 comments

Small issue; likely an easy fix; edit --version leaves a trailing space

edit version 1.2.0, Ubuntu 24.04, bash 5.2.21

Example:

ABC=$(./edit --version) ; echo ${#ABC} 19

GHI=$(./edit --version | sed -e 's/[[:space:]]*$//') ; echo ${#GHI} 18

Within edit/src/bin/edit/main.rs variable CARGO_PKG_VERSION is called in lines 287 - 289. Perhaps CARGO_PKG_VERSION contains a trailing space? Unfamiliar with RUST so just making a guess. Within my install/upgrade BASH script this causes an issue when comparing the latest version (minus the leading 'v') with the installed version. sed 'fixes' that as a workaround.

I use similar comparison logic to install/upgrade eksctl, go, powershell and sam (aws) without needing sed to trim trailing white space when checking the installed version.

If possible/easy please remove the trailing space from edit --version.

Thanks.

SupSkiFun avatar Jun 26 '25 05:06 SupSkiFun