Unverified Commit 5d77e944 authored by Luiz Ferraz's avatar Luiz Ferraz
Browse files

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

parent ca95f89a
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -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)