Merge pull request #306593 from DerRockWolf/update/stackit-cli

stackit-cli: 0.2.2 -> 0.2.3
This commit is contained in:
Nick Cao 2024-04-25 10:02:33 -04:00 committed by GitHub
commit 8d98cc4cae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 17 deletions

View File

@ -12,16 +12,16 @@
buildGoModule rec {
pname = "stackit-cli";
version = "0.2.2";
version = "0.2.3";
src = fetchFromGitHub {
owner = "stackitcloud";
repo = "stackit-cli";
rev = "v${version}";
hash = "sha256-0SI7hRJxdtdpGgEsUCWNsIcT50W7uyxLs5Mp+alHE0I=";
hash = "sha256-ci7P0VbIuYoIzaiNhUCNRFa3YxYxBsat5U46DwGq6WY=";
};
vendorHash = "sha256-FXy3qVSf57cPmxkY2XPEjFz3qRYkH5pPmCoIiWb28FY=";
vendorHash = "sha256-ecf/7BoCvybga8RVRiXvrAf2a5uLvIOFk4qNJiguSpo=";
subPackages = [ "." ];
@ -35,22 +35,13 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles makeWrapper ];
preCheck = ''
export HOME=$TMPDIR # needed because the binary always creates a dir & config file
'';
postInstall = ''
export HOME=$TMPDIR # needed because the binary always creates a dir & config file
mv $out/bin/{${pname},stackit} # rename the binary
installShellCompletion --cmd stackit --bash <($out/bin/stackit completion bash)
installShellCompletion --cmd stackit --zsh <($out/bin/stackit completion zsh)
installShellCompletion --cmd stackit --fish <($out/bin/stackit completion fish)
# Use this instead, once https://github.com/stackitcloud/stackit-cli/issues/153 is fixed:
# installShellCompletion --cmd stackit \
# --bash <($out/bin/stackit completion bash) \
# --zsh <($out/bin/stackit completion zsh) \
# --fish <($out/bin/stackit completion fish)
installShellCompletion --cmd stackit \
--bash <($out/bin/stackit completion bash) \
--zsh <($out/bin/stackit completion zsh) \
--fish <($out/bin/stackit completion fish)
# Ensure that all 3 completion scripts exist AND have content (should be kept for regression testing)
[ $(find $out/share -not -empty -type f | wc -l) -eq 3 ]
'';
@ -65,7 +56,7 @@ buildGoModule rec {
passthru.tests = {
version = testers.testVersion {
package = stackit-cli;
command = "HOME=$TMPDIR stackit --version";
command = "stackit --version";
};
};