changed to use new flag in regex operations

This commit is contained in:
jakeg00dwin 2024-03-20 13:40:52 -07:00
parent 6c7907f5c0
commit be025d228e
1 changed files with 7 additions and 7 deletions

12
otto.sh
View File

@ -42,16 +42,16 @@ add_module_to_cmakes () {
echo "add_subdirectory(${basename})" >> ./src/CMakeLists.txt
# Tests cmake file needs to be edited in place.
sed "s/# TEST_DIRS.*$/# TEST_DIRS\radd_subdirectory(${basename})\r/g" ./tests/CMakeLists.txt > ./tests/CMakeLists.txt
sed "s/# TEST_LINKS.*$/# TEST_LINKS\r${basename}/g" ./tests/CMakeLists.txt > ./tests/CMakeLists.txt
sed -i'' "s/# TEST_DIRS.*$/# TEST_DIRS\r\nadd_subdirectory(${basename})/g" ./tests/CMakeLists.txt
sed -i'' "s/# TEST_LINKS.*$/# TEST_LINKS\r\n${basename}/g" ./tests/CMakeLists.txt
}
remove_module_from_cmakes () {
local basename="$1"
sed "s/^.*add_subdirectory(${basename}).*$//g" ./src/CMakeLists.txt > ./src/CMakeLists.txt
sed "s/^.*add_subdirectory(${basename}).*$//g" ./tests/CMakeLists.txt > ./tests/CMakeLists.txt
set "s/^.*${basename}.*$//g" ./tests/CMakeLists.txt > ./tests/CMakeLists.txt
sed -i'' "s/^.*add_subdirectory(${basename}).*$//g" ./src/CMakeLists.txt
sed -i'' "s/^.*add_subdirectory(${basename}).*$//g" ./tests/CMakeLists.txt
sed -i'' "s/^.*${basename}.*$//g" ./tests/CMakeLists.txt
}
git_add_module () {
@ -59,7 +59,7 @@ git_add_module () {
local basename="$1"
read -p "Auto add to git?(y/n):" CHOICE
if [ "${CHOICE}" -eq "n" ]; then
if [ "${CHOICE}" = "n" ]; then
echo "not being added!"
return 0
fi