Only try updating setup.cfg if the file exists

sometimes setup.cfg doesn't exist. added a check to make sure it exists before attempting to update it
This commit is contained in:
Thomas Woolford 2022-05-10 15:25:58 +09:30 committed by GitHub
parent 058fe3e15a
commit 42a7740a37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1690,7 +1690,10 @@ lib.composeManyExtensions [
old: {
# Fixes https://github.com/pytest-dev/pytest/issues/7891
postPatch = old.postPatch or "" + ''
sed -i '/\[metadata\]/aversion = ${old.version}' setup.cfg
# sometimes setup.cfg doesn't exist
if [ -f setup.cfg ]; then
sed -i '/\[metadata\]/aversion = ${old.version}' setup.cfg
fi
'';
}
);