python_test_project/.gitea/rename_project.sh

37 lines
958 B
Bash
Raw Permalink Normal View History

2024-11-11 06:11:21 -08:00
#!/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..."
2024-11-11 06:12:40 -08:00
original_author="Projects"
original_name="python_test_project"
original_urlname="python_test_project"
original_description="Awesome python_test_project created by Projects"
2024-11-11 06:11:21 -08:00
# 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
2024-11-11 06:12:40 -08:00
mv python_test_project $name
2024-11-11 06:11:21 -08:00
# This command runs only once on GHA!
rm -rf .gitea/template.yml