Added support for the MacOS version of find.
This commit is contained in:
parent
0a8a598867
commit
f32cc3340a
1 changed files with 16 additions and 7 deletions
|
@ -41,16 +41,25 @@ if [[ $author == *%* ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy the template directory
|
# Copy the template directory
|
||||||
cp -r -T template_module "$module_dir"
|
cp -r template_module "$module_dir"
|
||||||
cd "$module_dir"
|
cd "$module_dir"
|
||||||
|
|
||||||
# Fill in the blanks in the template
|
# Fill in the blanks in the template
|
||||||
sed -i "
|
if [ "$(uname)" == "Darwin" ]; then
|
||||||
s/{YEAR}/$(date +%Y)/
|
sed -i '' -e "
|
||||||
s%{AUTHOR}%$author%
|
s/{YEAR}/$(date +%Y)/
|
||||||
s%{MODULE_NAME}%$module_name%
|
s%{AUTHOR}%$author%
|
||||||
s%{MODULE}%$module%
|
s%{MODULE_NAME}%$module_name%
|
||||||
" $(find -type f)
|
s%{MODULE}%$module%
|
||||||
|
" $(find . -type f)
|
||||||
|
else
|
||||||
|
sed -i "
|
||||||
|
s/{YEAR}/$(date +%Y)/
|
||||||
|
s%{AUTHOR}%$author%
|
||||||
|
s%{MODULE_NAME}%$module_name%
|
||||||
|
s%{MODULE}%$module%
|
||||||
|
" $(find -type f)
|
||||||
|
fi
|
||||||
# Arduino IDE requires .ino sketches to have the same name as their directory
|
# Arduino IDE requires .ino sketches to have the same name as their directory
|
||||||
mv main.ino "$module.ino"
|
mv main.ino "$module.ino"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue