turso-cli: Install shell completions

This commit is contained in:
Luiz Ferraz 2023-10-04 20:53:31 -03:00 committed by Weijia Wang
parent 9f20229c6c
commit d8abaa6147

View file

@ -1,12 +1,16 @@
{
lib,
stdenv,
buildGo121Module,
fetchFromGitHub,
installShellFiles,
}:
buildGo121Module rec {
pname = "turso-cli";
version = "0.85.3";
nativeBuildInputs = [ installShellFiles ];
src = fetchFromGitHub {
owner = "tursodatabase";
repo = "turso-cli";
@ -23,6 +27,13 @@ buildGo121Module rec {
echo "v${version}" > internal/cmd/version.txt
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd turso \
--bash <($out/bin/turso completion bash) \
--fish <($out/bin/turso completion fish) \
--zsh <($out/bin/turso completion zsh)
'';
# Test_setDatabasesCache fails due to /homeless-shelter: read-only file system error.
doCheck = false;