4
0
mirror of https://github.com/QuasarApp/Credits.git synced 2025-05-08 15:39:43 +00:00
2021-03-18 17:39:15 +03:00

32 lines
702 B
Bash
Executable File

#!/bin/sh
echo "Project name: $1"
if [ $# -ne 1 ]
then
echo "You call this script wtth wrong arguments."
echo "Example for start script:"
echo "./init.sh MyCmakeProject"
exit 1
fi
REPLACESTRING="s+RENAME_ME+$1+g"
echo $REPLACESTRING
find . -type f -exec sed -i $REPLACESTRING {} +
find . -type f -exec sed -i $REPLACESTRING {} +
#find . -type f -exec sed -i 's+http://example.com+https://example.com+g' {} +
set -e
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
url=$(git config -f .gitmodules --get "$url_key")
git submodule add $url $path
done