1
1
mirror of https://github.com/nmattia/niv.git synced 2024-11-07 22:36:53 +03:00

Don't IFD when testing README

This commit is contained in:
Nicolas Mattia 2020-02-22 18:41:39 +01:00
parent 140dd34d49
commit f2e2502412
2 changed files with 24 additions and 25 deletions

View File

@ -223,7 +223,6 @@ Available commands:
modify Modify dependency attributes without performing an modify Modify dependency attributes without performing an
update update
drop Drop dependency drop Drop dependency
``` ```
#### Add #### Add
@ -261,7 +260,6 @@ Available options:
Experimental commands: Experimental commands:
git Add a git dependency. Experimental. git Add a git dependency. Experimental.
github Add a GitHub dependency github Add a GitHub dependency
``` ```
#### Update #### Update
@ -294,7 +292,6 @@ Available options:
'file' or 'tarball'. If not set, the value is 'file' or 'tarball'. If not set, the value is
inferred from the suffix of the URL. inferred from the suffix of the URL.
-h,--help Show this help text -h,--help Show this help text
``` ```
#### Modify #### Modify
@ -327,7 +324,6 @@ Available options:
'file' or 'tarball'. If not set, the value is 'file' or 'tarball'. If not set, the value is
inferred from the suffix of the URL. inferred from the suffix of the URL.
-h,--help Show this help text -h,--help Show this help text
``` ```
#### Drop #### Drop
@ -343,7 +339,6 @@ Usage: niv drop PACKAGE [ATTRIBUTE]
Available options: Available options:
-h,--help Show this help text -h,--help Show this help text
``` ```
#### Init #### Init
@ -354,7 +349,6 @@ Usage: niv init
Available options: Available options:
-h,--help Show this help text -h,--help Show this help text
``` ```
#### show #### show
@ -364,7 +358,6 @@ Usage: niv show [PACKAGE]
Available options: Available options:
-h,--help Show this help text -h,--help Show this help text
``` ```
[Nix]: https://nixos.org/nix/ [Nix]: https://nixos.org/nix/

View File

@ -195,24 +195,30 @@ rec
tests-github = pkgs.callPackage ./tests/github { inherit niv; }; tests-github = pkgs.callPackage ./tests/github { inherit niv; };
tests-git = pkgs.callPackage ./tests/git { inherit niv; }; tests-git = pkgs.callPackage ./tests/git { inherit niv; };
readme = pkgs.writeText "README.md" ( readme = pkgs.runCommand "README.md" { nativeBuildInputs = [ niv ]; }
let ''
template = builtins.readFile ./README.tpl.md; cp ${./README.tpl.md} $out
niv_help = builtins.readFile ( sed -i "/replace_niv_help/r"<(niv --help) $out
pkgs.runCommand "niv_help" { buildInputs = [ niv ]; } sed -i "/replace_niv_help/d" $out
"niv --help > $out"
); sed -i "/replace_niv_add_help/r"<(niv add --help) $out
niv_cmd_help = cmd: builtins.readFile ( sed -i "/replace_niv_add_help/d" $out
pkgs.runCommand "niv_${cmd}_help" { buildInputs = [ niv ]; }
"niv ${cmd} --help > $out" sed -i "/replace_niv_update_help/r"<(niv update --help) $out
); sed -i "/replace_niv_update_help/d" $out
cmds = [ "add" "update" "modify" "drop" "init" "show" ];
in sed -i "/replace_niv_modify_help/r"<(niv modify --help) $out
pkgs.lib.replaceStrings sed -i "/replace_niv_modify_help/d" $out
([ "replace_niv_help" ] ++ (map (cmd: "replace_niv_${cmd}_help") cmds))
([ niv_help ] ++ (map niv_cmd_help cmds)) sed -i "/replace_niv_drop_help/r"<(niv drop --help) $out
template sed -i "/replace_niv_drop_help/d" $out
);
sed -i "/replace_niv_init_help/r"<(niv init --help) $out
sed -i "/replace_niv_init_help/d" $out
sed -i "/replace_niv_show_help/r"<(niv show --help) $out
sed -i "/replace_niv_show_help/d" $out
'';
readme-test = pkgs.runCommand "README-test" {} readme-test = pkgs.runCommand "README-test" {}
'' ''