Skip to content

Commit 9e08da1

Browse files
committed
Change update_sources.sh to not break if no '*.puml' files are found.
1 parent 5fb6177 commit 9e08da1

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

update_sources.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,24 @@ update_sources() {
4444
readonly iLength=$(( "${#sSourcePath} + ${#sSource}" + 1))
4545
echo ' -----> Copying "*.puml" files'
4646

47-
find "${sSourcePath}/${sSource}" -name '*.puml' -print0 |
48-
while read -r -d $'\0' sFilePath; do
49-
sSourceFile="${sSourcePath}/${sSource}${sFilePath:${iLength}}"
50-
sTargetFile="${sTargetPath}/${sPath}/${sFilePath:${iLength}}"
47+
if [ "$(find "${sSourcePath}/${sSource}" -name '*.puml')" ];then
48+
find "${sSourcePath}/${sSource}" -name '*.puml' -print0 |
49+
while read -r -d $'\0' sFilePath; do
50+
sSourceFile="${sSourcePath}/${sSource}${sFilePath:${iLength}}"
51+
sTargetFile="${sTargetPath}/${sPath}/${sFilePath:${iLength}}"
5152

5253
sTargetFolder="$(dirname "${sTargetFile}")"
5354

5455
if [[ ! -d "${sTargetFolder}" ]];then
5556
mkdir -p "${sTargetFolder}"
5657
fi
5758

58-
cp "${sSourceFile}" "${sTargetFile}"
59-
done
59+
cp "${sSourceFile}" "${sTargetFile}"
60+
done
61+
else
62+
echo -e "\tNo '*.puml' files found. Skipping"
63+
# @TODO: Check if there is an SVG (or PNG?) source dir and generate '*.puml' files from there
64+
fi
6065
fi
6166
}
6267

0 commit comments

Comments
 (0)