Skip to content

Commit cdd09ec

Browse files
committed
#13 Check bob SHA
1 parent 052bd16 commit cdd09ec

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

deployer.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,21 @@ fi
134134
echo -e "Using Bob version \x1B[35m${bob_version}\x1B[0m SHA: \x1B[35m${bob_sha}\x1B[0m"
135135

136136
bob_path="${bob_folder}bob${bob_version}.jar"
137-
if [ ! -f ${bob_path} ]; then
138-
BOB_URL="https://d.defold.com/archive/${bob_channel}/${bob_sha}/bob/bob.jar"
139-
echo "Unable to find bob${bob_version}.jar. Downloading it from d.defold.com: ${BOB_URL}}"
140-
echo "curl -L -o ${bob_path} ${BOB_URL}"
141-
curl -L -o ${bob_path} ${BOB_URL}
137+
download_bob() {
138+
if [ ! -f ${bob_path} ]; then
139+
BOB_URL="https://d.defold.com/archive/${bob_channel}/${bob_sha}/bob/bob.jar"
140+
echo "Unable to find bob${bob_version}.jar. Downloading it from d.defold.com: ${BOB_URL}}"
141+
echo "curl -L -o ${bob_path} ${BOB_URL}"
142+
curl -L -o ${bob_path} ${BOB_URL}
143+
fi
144+
}
145+
download_bob
146+
147+
real_bob_sha=$(java -jar ${bob_path} --version | cut -d ":" -f3 | cut -d " " -f2)
148+
if [ ! ${real_bob_sha} == ${bob_sha} ]; then
149+
echo "Bob SHA mismatch (file bob SHA and settings bob SHA). Redownloading..."
150+
rm ${bob_path}
151+
download_bob
142152
fi
143153

144154

0 commit comments

Comments
 (0)