lol

jcli: modernize

+13 -6
+13 -6
pkgs/by-name/jc/jcli/package.nix
··· 2 2 lib, 3 3 stdenv, 4 4 buildGoModule, 5 + buildPackages, 5 6 fetchFromGitHub, 6 7 installShellFiles, 7 8 }: ··· 30 31 nativeBuildInputs = [ installShellFiles ]; 31 32 32 33 postInstall = 34 + let 35 + jcliBin = 36 + if stdenv.buildPlatform.canExecute stdenv.hostPlatform then 37 + "$out" 38 + else 39 + lib.getBin buildPackages.jcli; 40 + in 33 41 '' 34 42 mv $out/bin/{jenkins-cli,jcli} 35 - '' 36 - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' 43 + 37 44 installShellCompletion --cmd jcli \ 38 - --bash <($out/bin/jcli completion --type bash) \ 39 - --fish <($out/bin/jcli completion --type fish) \ 40 - --zsh <($out/bin/jcli completion --type zsh) 45 + --bash <(${jcliBin}/bin/jcli completion --type bash) \ 46 + --fish <(${jcliBin}/bin/jcli completion --type fish) \ 47 + --zsh <(${jcliBin}/bin/jcli completion --type zsh) 41 48 ''; 42 49 43 50 meta = { 44 51 description = "Jenkins CLI allows you to manage your Jenkins in an easy way"; 45 52 mainProgram = "jcli"; 46 53 homepage = "https://github.com/jenkins-zh/jenkins-cli"; 47 - changelog = "https://github.com/jenkins-zh/jenkins-cli/releases/tag/${src.tag}"; 54 + changelog = "https://github.com/jenkins-zh/jenkins-cli/releases/tag/v${version}"; 48 55 license = lib.licenses.mit; 49 56 maintainers = with lib.maintainers; [ sikmir ]; 50 57 };