diff --git a/otto.sh b/otto.sh index 1575b3d..c82a96a 100755 --- a/otto.sh +++ b/otto.sh @@ -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,11 +59,11 @@ 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 - + modsrc_dir="./src/${basename}" modtest_dir="./tests/${basename}"