Skip to content

Commit 4e4c7f8

Browse files
authored
Merge pull request #110 from Salamandar/fix_losetup_file_not_found
Check if loopback file exists before deleting it
2 parents cd75b84 + f30b4e6 commit 4e4c7f8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/common.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ function detach_all_loopback(){
153153
# Cleans up mounted loopback devices from the image name
154154
# NOTE: it might need a better way to grep for the image name, its might clash with other builds
155155
for img in $(losetup | grep $1 | awk '{ print $1 }' ); do
156-
losetup -d $img
156+
if [[ -f $img ]]; then
157+
losetup -d $img
158+
fi
157159
done
158160
}
159161

0 commit comments

Comments
 (0)