Dotnet_Library/.gitea/rename_project.sh
Simon Diesenreiter aef00a63cf
Some checks failed
Rename the project from template / rename-project (push) Has been skipped
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m30s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
SonarQube Scan / SonarQube Trigger (push) Failing after 10m52s
ci: bugfixes with workflows, ref: NOISSUE
2024-12-02 06:41:12 +01:00

43 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
while getopts a:n:u:d: flag
do
case "${flag}" in
a) author=${OPTARG};;
n) name=${OPTARG};;
u) urlname=${OPTARG};;
d) description=${OPTARG};;
esac
done
echo "Author: $author";
echo "Project Name: $name";
echo "Project URL name: $urlname";
echo "Description: $description";
echo "Renaming project..."
original_author="author_name"
original_name="project_name"
original_urlname="project_urlname"
original_description="project_description"
# for filename in $(find . -name "*.*")
for filename in $(git ls-files)
do
sed -i "s/$original_author/$author/g" $filename
sed -i "s/$original_name/$name/g" $filename
sed -i "s/$original_urlname/$urlname/g" $filename
sed -i "s/$original_description/$description/g" $filename
echo "Renamed $filename"
done
mv project_name $name
mv project_name.Tests $name.Tests
mv project_name.sln $name.sln
mv $name/project_name.csproj $name/$name.csproj
mv $name.Tests/project_name.Tests.csproj $name.Tests/$name.Tests.csproj
# This command runs only once on GHA!
rm -rf .gitea/template.yml
rm -rf project_name
rm -rf project_name.Tests