depot/third_party/nixpkgs/pkgs/by-name/cl/clever-tools/package.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

46 lines
1.2 KiB
Nix

{ lib
, buildNpmPackage
, fetchFromGitHub
, nodejs_18
, installShellFiles
, stdenv
}:
buildNpmPackage rec {
pname = "clever-tools";
version = "3.8.1";
nodejs = nodejs_18;
src = fetchFromGitHub {
owner = "CleverCloud";
repo = "clever-tools";
rev = version;
hash = "sha256-8dxV57uivjcXz6JHttFNvivcIbNRAwZKSvGv/SST81E=";
};
npmDepsHash = "sha256-2lROdsq3tR4SYxMoTJYY6EyHxudS7p7wOJq+RxE2btk=";
dontNpmBuild = true;
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd clever \
--bash <($out/bin/clever --bash-autocomplete-script $out/bin/clever) \
--zsh <($out/bin/clever --zsh-autocomplete-script $out/bin/clever)
'' + ''
rm $out/bin/install-clever-completion
rm $out/bin/uninstall-clever-completion
'';
meta = with lib; {
homepage = "https://github.com/CleverCloud/clever-tools";
changelog = "https://github.com/CleverCloud/clever-tools/blob/${version}/CHANGELOG.md";
description = "Deploy on Clever Cloud and control your applications, add-ons, services from command line";
license = licenses.asl20;
mainProgram = "clever";
maintainers = teams.clevercloud.members;
};
}