Merge pull request #277065 from shyim/opensearch-cli

opensearch-cli: init at 1.2.0
This commit is contained in:
Pol Dellaiera 2023-12-27 13:42:04 +01:00 committed by GitHub
commit 58da85371b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,38 @@
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
buildGoModule rec {
pname = "opensearch-cli";
version = "1.2.0";
src = fetchFromGitHub {
repo = "opensearch-cli";
owner = "opensearch-project";
rev = version;
hash = "sha256-Ah64a9hpc2tnIXiwxg/slE6fUTAoHv9koNmlUHrVj/s=";
};
vendorHash = "sha256-r3Bnud8pd0Z9XmGkj9yxRW4U/Ry4U8gvVF4pAdN14lQ=";
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
export HOME="$(mktemp -d)"
installShellCompletion --cmd opensearch-cli \
--bash <($out/bin/opensearch-cli completion bash) \
--zsh <($out/bin/opensearch-cli completion zsh) \
--fish <($out/bin/opensearch-cli completion fish)
'';
meta = {
description = "A full-featured command line interface (CLI) for OpenSearch.";
homepage = "https://github.com/opensearch-project/opensearch-cli";
license = lib.licenses.asl20;
mainProgram = "opensearch-cli";
maintainers = with lib.maintainers; [ shyim ];
platforms = lib.platforms.unix;
sourceProvenance = with lib.sourceTypes; [ fromSource ];
};
}

View File

@ -41,7 +41,8 @@ stdenvNoCC.mkDerivation (finalAttrs: {
--set JAVA_HOME "${jre_headless}"
wrapProgram $out/bin/opensearch-plugin --set JAVA_HOME "${jre_headless}"
wrapProgram $out/bin/opensearch-cli --set JAVA_HOME "${jre_headless}"
rm $out/bin/opensearch-cli
runHook postInstall
'';