tilt: add completions (#374349)
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
src,
|
||||
version,
|
||||
tilt-assets,
|
||||
stdenv,
|
||||
installShellFiles,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
@@ -21,6 +23,15 @@ buildGoModule rec {
|
||||
|
||||
ldflags = [ "-X main.version=${version}" ];
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd tilt \
|
||||
--bash <($out/bin/tilt completion bash) \
|
||||
--fish <($out/bin/tilt completion fish) \
|
||||
--zsh <($out/bin/tilt completion zsh)
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
mkdir -p pkg/assets/build
|
||||
cp -r ${tilt-assets}/* pkg/assets/build/
|
||||
|
||||
Reference in New Issue
Block a user