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

View file

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