Skip to content

Commit beeb8ff

Browse files
author
Vitor Hugo Homem Marzarotto
committed
Update templateConfig.sh to not break with directorys with space on the names
1 parent f0838cd commit beeb8ff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

engine/schema/templateConfig.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function getChecksum() {
5454

5555
function createMetadataFile() {
5656
local fileData=$(cat $SOURCEFILE)
57-
echo -e "["default"]\nversion = $VERSION.${securityversion}\n" >> $METADATAFILE
57+
echo -e "["default"]\nversion = $VERSION.${securityversion}\n" >> "$METADATAFILE"
5858
for template in "${templates[@]}"
5959
do
6060
section="${template%%:*}"
@@ -64,7 +64,7 @@ function createMetadataFile() {
6464
checksum=$(getChecksum "$fileData" "$VERSION-$hvName")
6565
downloadurl="${template#*:}"
6666
filename=$(echo ${downloadurl##*'/'})
67-
echo -e "["$section"]\ntemplatename = $templatename\nchecksum = $checksum\ndownloadurl = $downloadurl\nfilename = $filename\n" >> $METADATAFILE
67+
echo -e "["$section"]\ntemplatename = $templatename\nchecksum = $checksum\ndownloadurl = $downloadurl\nfilename = $filename\n" >> "$METADATAFILE"
6868
done
6969
}
7070

@@ -79,7 +79,7 @@ templates=( "kvm:https://download.cloudstack.org/systemvm/${CS_VERSION}/systemvm
7979

8080
PARENTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/dist/systemvm-templates/"
8181
mkdir -p $PARENTPATH
82-
METADATAFILE=${PARENTPATH}"metadata.ini"
83-
echo > $METADATAFILE
82+
METADATAFILE="${PARENTPATH}metadata.ini"
83+
echo > "$METADATAFILE"
8484
SOURCEFILE=${PARENTPATH}'md5sum.txt'
8585
createMetadataFile

0 commit comments

Comments
 (0)