'How to check if a file is changed in svn and decide the next action based on it in a script
I want to write a bash script That if a file is changed then I commit. is there a command that returns true or false so That I can check it in my "If the file is changed?"
I have:
if ???
svn --trust-server-cert --non-interactive --username MYUSERNAME --password MYPASSWORD commit . -m "MY COMMENT"`;
I created a .sh file and here is the content just to test what svn status is returning and even if there is no change to the file it returns "$SVNST is NOT empty":
#!/bin/bash
echo "Hello world"
SVNST=$`svn status MYFILE`
echo $SVNST
if [ -z "$SVNST" ]
then
echo "\$SVNST is empty"
else
echo "\$SVNST is NOT empty"
fi
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
