src/new-ebuild: only create ebuilds if they don't exist

Signed-off-by: Maciej Barć <xgqt@protonmail.com>
This commit is contained in:
Maciej Barć 2020-12-25 14:04:13 +01:00
parent f8e53b113b
commit 1aab1497bf
No known key found for this signature in database
GPG Key ID: 031C9FE65BED714A
1 changed files with 18 additions and 2 deletions

View File

@ -42,10 +42,26 @@ metadata_template='<?xml version="1.0" encoding="UTF-8"?>
</pkgmetadata>'
main() {
ebuild="$(basename "$(pwd)")-9999.ebuild"
if [ ! -f "${ebuild}" ]
then
echo "${ebuild_template}" > "${ebuild}"
else
echo "Already exists: ${ebuild}"
fi
if [ ! -f "metadata.xml" ]
then
echo "${metadata_template}" > "metadata.xml"
else
echo "Already exists: metadata.xml"
fi
}
if [ -f ../../profiles/repo_name ]
then
echo "${ebuild_template}" >> "$(basename "$(pwd)")-9999.ebuild"
echo "${metadata_template}" >> "metadata.xml"
main
else
echo "Are you in a overlay repo?"
echo "To use this script successfully:"