'if condition for checking a tortoiseSVN update into a linux bash
I am working with a SVN server into a linux computer.I am trying to develop bash code for making the compilation automatically. The thing is that I do not want to compile the files if there have not been an update into my SVN server. so the first thing I do is checking for updates.
this way:
if svn update; then
...
fi
the problem is that even if there are not updates it enters into the if condition as it has to check for updates. I would like to Know if there is a way of checking if an update had occurred or not.
thank you.
Solution 1:[1]
The simplest way:
[ $(svn up|wc -l) != 2 ] && (
echo "Your code here"
) || (
echo "No changes."
)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Zibri |