more robust removeSwap

During my nixos-infect tests I have sometimes canceled infection in the middle.
Rerun of nixos-infect failed because there were some old swap files, which
were no longer available as swap devices.

`swapoff -a` will handle this for us (we are going reboot anyway)
This commit is contained in:
Danylo Hlynskyi 2018-07-13 00:27:59 +03:00 committed by Eric Litak
parent 89b92f3de1
commit 1f8634dd48
1 changed files with 2 additions and 5 deletions

View File

@ -127,11 +127,8 @@ makeSwap() {
}
removeSwap() {
for swapFile in /tmp/nixos-infect.*.swp
do
swapoff -v "$swapFile"
rm -vf "$swapFile"
done
swapoff -a
rm -vf /tmp/nixos-infect.*.swp
}
prepareEnv() {