turso-cli: Use ldflags to set the version instead of embedding

This commit is contained in:
Luiz Ferraz 2023-10-18 10:26:49 -03:00
parent ca95f89a74
commit 5d77e9448a
No known key found for this signature in database
GPG Key ID: 2B568731DB2447EC

View File

@ -21,12 +21,9 @@ buildGo121Module rec {
nativeBuildInputs = [ installShellFiles ];
# Build with production code
tags = ["prod"];
# Include version for `turso --version` reporting
preBuild = ''
echo "v${version}" > internal/cmd/version.txt
'';
ldflags = [
"-X github.com/tursodatabase/turso-cli/internal/cmd.version=v${version}"
];
preCheck = ''
export HOME=$(mktemp -d)