mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 09:23:01 +00:00
21 lines
411 B
Nix
21 lines
411 B
Nix
{ runCommandLocal, maid }:
|
|
|
|
runCommandLocal "test-maid-run" {
|
|
nativeBuildInputs = [ maid ];
|
|
}
|
|
''
|
|
mkdir -p $out/test
|
|
export HOME=$out
|
|
cd $out
|
|
touch test/a.iso test/b.txt
|
|
cat > rules.rb <<EOF
|
|
Maid.rules do
|
|
rule 'ISO' do
|
|
trash(dir('test/*.iso'))
|
|
end
|
|
end
|
|
EOF
|
|
maid clean --rules rules.rb --force
|
|
[ -f test/b.txt ] && [ ! -f test/a.iso ]
|
|
''
|