mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-28 19:00:46 +00:00
faas-cli: modernize (#546997)
This commit is contained in:
@@ -6,8 +6,7 @@
|
||||
makeWrapper,
|
||||
git,
|
||||
installShellFiles,
|
||||
testers,
|
||||
faas-cli,
|
||||
versionCheckHook,
|
||||
}:
|
||||
let
|
||||
faasPlatform =
|
||||
@@ -26,11 +25,13 @@ buildGoModule (finalAttrs: {
|
||||
pname = "faas-cli";
|
||||
version = "0.18.12";
|
||||
|
||||
__structuredAttrs = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "openfaas";
|
||||
repo = "faas-cli";
|
||||
rev = finalAttrs.version;
|
||||
sha256 = "sha256-I7P30c7rEVqemgUu/1AtM6jq2f4KB8xyDpjGBMvkLRU=";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-I7P30c7rEVqemgUu/1AtM6jq2f4KB8xyDpjGBMvkLRU=";
|
||||
};
|
||||
|
||||
vendorHash = null;
|
||||
@@ -41,7 +42,6 @@ buildGoModule (finalAttrs: {
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X github.com/openfaas/faas-cli/version.GitCommit=ref/tags/${finalAttrs.version}"
|
||||
"-X github.com/openfaas/faas-cli/version.Version=${finalAttrs.version}"
|
||||
"-X github.com/openfaas/faas-cli/commands.Platform=${faasPlatform stdenv.hostPlatform}"
|
||||
@@ -61,10 +61,9 @@ buildGoModule (finalAttrs: {
|
||||
--zsh <($out/bin/faas-cli completion --shell zsh)
|
||||
'';
|
||||
|
||||
passthru.tests.version = testers.testVersion {
|
||||
command = "${faas-cli}/bin/faas-cli version --short-version --warn-update=false";
|
||||
package = faas-cli;
|
||||
};
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
versionCheckProgramArg = "version";
|
||||
doInstallCheck = true;
|
||||
|
||||
meta = {
|
||||
description = "Official CLI for OpenFaaS";
|
||||
|
||||
Reference in New Issue
Block a user