Skip to content

Commit c6eeb75

Browse files
Vitor Hugo Homem Marzarottohsato03
authored andcommitted
Update templateConfig.sh to not break with directorys with space on the names
1 parent e8200a0 commit c6eeb75

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
@@ -63,7 +63,7 @@ function getChecksum() {
6363

6464
function createMetadataFile() {
6565
local fileData=$(cat $SOURCEFILE)
66-
echo -e "["default"]\nversion = $VERSION.${securityversion}\n" >> $METADATAFILE
66+
echo -e "["default"]\nversion = $VERSION.${securityversion}\n" >> "$METADATAFILE"
6767
for template in "${templates[@]}"
6868
do
6969
section="${template%%:*}"
@@ -76,7 +76,7 @@ function createMetadataFile() {
7676
templatename="systemvm-${sectionHv%.*}-${VERSION}-${arch}"
7777
checksum=$(getChecksum "$fileData" "$VERSION-${arch}-$hvName")
7878
filename=$(echo ${downloadurl##*'/'})
79-
echo -e "["$section"]\ntemplatename = $templatename\nchecksum = $checksum\ndownloadurl = $downloadurl\nfilename = $filename\narch = $arch\nguestos = $guestos\n" >> $METADATAFILE
79+
echo -e "["$section"]\ntemplatename = $templatename\nchecksum = $checksum\ndownloadurl = $downloadurl\nfilename = $filename\narch = $arch\nguestos = $guestos\n" >> "$METADATAFILE"
8080
done
8181
}
8282

@@ -92,7 +92,7 @@ templates=( "kvm-x86_64:https://download.cloudstack.org/systemvm/${CS_VERSION}/s
9292

9393
PARENTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/dist/systemvm-templates/"
9494
mkdir -p $PARENTPATH
95-
METADATAFILE=${PARENTPATH}"metadata.ini"
96-
echo > $METADATAFILE
95+
METADATAFILE="${PARENTPATH}metadata.ini"
96+
echo > "$METADATAFILE"
9797
SOURCEFILE=${PARENTPATH}'md5sum.txt'
9898
createMetadataFile

0 commit comments

Comments
 (0)