Merged release and merge preparation scripts

This commit is contained in:
2020-01-16 12:00:51 +01:00
parent 876ceb7e39
commit c7c5567049
2 changed files with 67 additions and 45 deletions

View File

@@ -1,15 +0,0 @@
# Run CPP Check
echo "Running CPPCheck..."
cppcheck --enable=all --output-file=cppcheck_errors.txt src/
cppcheck --check-config --output-file=cppcheck_config.txt src/
echo "CPPCheck finished"
# Uncrustify Files
echo "Running Uncrustify..."
find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) -exec uncrustify -c conf/uncrustify.cfg --no-backup {} +
echo "Uncrustify finished."
# Adding changes to git
echo "Committing Changes to Git..."
git add '*'
git commit -m "Automated Merge Preparation"
echo "Committed."
echo "Finished."

View File

@@ -1,30 +1,67 @@
# Discarding local changes printLine(){
echo "\033[0;33mThis will discard all your uncommited changes and restore the last commit. Continue?\033[0m" echo "$2$1 \033[0m"
read }
git reset --hard
# Run CPP Check resetGit(){
echo "Running CPPCheck..." printLine "This will discard all your uncommited changes and restore the last commit. Continue?" "\033[0;33m"
cppcheck --enable=all --output-file=cppcheck_errors.txt src/ read
cppcheck --check-config --output-file=cppcheck_config.txt src/ git reset --hard
echo "\033[0;32mCPPCheck finished\033[0m" printLine "Git resetted." "\033[0;32m"
# Uncrustify Files }
echo "Running Uncrustify..."
find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) -exec uncrustify -c conf/uncrustify.cfg --no-backup {} + runCPPCheck(){
echo "\033[0;32mUncrustify finished.\033[0m" printLine "Running CPPCheck..."
# Remove Overhead Folders/ Files cppcheck --enable=all --output-file=cppcheck_errors.txt src/
echo "Cleaning directory..." cppcheck --check-config --output-file=cppcheck_config.txt src/
rm -r src/build-* printLine "CPPCheck finished" "\033[0;32m"
rm -r build-*/ }
rm -r Examples/
rm src/*.pro.user runUncrustify(){
echo "\033[0;32mDirectory cleaned.\033[0m" printLine "Running Uncrustify..."
# Run Doxygen find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) -exec uncrustify -c conf/uncrustify.cfg --no-backup {} +
echo "Running Doxygen..." printLine "Uncrustify finished." "\033[0;32m"
doxygen conf/intelliphoto_dox }
echo "\033[0;32mDoxygen finished.\033[0m"
# Adding changes to git cleanDir(){
echo "Committing Changes to Git..." printLine "Cleaning directory..."
git add '*' rm -r src/build-*
git commit -m "Automated Release Preparation" rm -r build-*/
echo "\033[0;32mCommitted.\033[0m" rm -r Examples/
echo "\033[0;32mFinished.\033[0m" rm src/*.pro.user
printLine "Directory cleaned." "\033[0;32m"
}
runDoxygen(){
printLine "Running Doxygen..."
doxygen conf/intelliphoto_dox
printLine "Doxygen finished." "\033[0;32m"
}
gitCommit(){
printLine "Committing Changes to Git..."
git add '*'
git commit -m "Automated Release Preparation"
printLine "Committed." "\033[0;32m"
}
prepareMerge(){
printLine "Merge Preparation started..."
printLine "Finished." "\033[0;32m"
exit
}
prepareRelease(){
printLine "Release Preparation started..."
printLine "Finished." "\033[0;32m"
exit
}
echo "Merge/ Release Preparation for IntelliPhoto started."
while true; do
read -p "Do you want to prepare a (m)erge or a (r)elease?" yn
case $yn in
[Mm]* ) prepareMerge;;
[Rr]* ) prepareRelease;;
* ) echo "Please answer (m)erge or (r)elease.";;
esac
done