mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 02:53:09 +03:00
amp-cli: add a smoketest for the binary
Just runs --version. Amp will try create a log directory in your homedir, so we need to give it a homedir it can write to. Additionally we remove the rec and use finalAttrs instead.
This commit is contained in:
parent
a98db0d69e
commit
c85d7c7db5
1 changed files with 9 additions and 4 deletions
|
@ -4,14 +4,15 @@
|
|||
fetchzip,
|
||||
ripgrep,
|
||||
makeWrapper,
|
||||
testers,
|
||||
}:
|
||||
|
||||
buildNpmPackage rec {
|
||||
buildNpmPackage (finalAttrs: {
|
||||
pname = "amp-cli";
|
||||
version = "0.0.1748404992-ga3f78f";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://registry.npmjs.org/@sourcegraph/amp/-/amp-${version}.tgz";
|
||||
url = "https://registry.npmjs.org/@sourcegraph/amp/-/amp-${finalAttrs.version}.tgz";
|
||||
hash = "sha256-axd5VP7afa4ptAl/y8CEVguqoRKVRhWfRDSI0sgyXqA=";
|
||||
};
|
||||
|
||||
|
@ -25,7 +26,7 @@ buildNpmPackage rec {
|
|||
"version": "0.0.0",
|
||||
"license": "UNLICENSED",
|
||||
"dependencies": {
|
||||
"@sourcegraph/amp": "${version}"
|
||||
"@sourcegraph/amp": "${finalAttrs.version}"
|
||||
},
|
||||
"bin": {
|
||||
"amp": "./bin/amp-wrapper.js"
|
||||
|
@ -69,6 +70,10 @@ buildNpmPackage rec {
|
|||
'';
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
passthru.tests.version = testers.testVersion {
|
||||
package = finalAttrs.finalPackage;
|
||||
command = "HOME=$(mktemp -d) amp --version";
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "CLI for Amp, an agentic coding agent in research preview from Sourcegraph";
|
||||
|
@ -81,4 +86,4 @@ buildNpmPackage rec {
|
|||
];
|
||||
mainProgram = "amp";
|
||||
};
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue