Skip to content

Commit 312444a

Browse files
Merge pull request #210 from RedisInsight/download_be_from_circleci
Added possibility to download BE from circleci
2 parents 6fd34ed + 70968f4 commit 312444a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/downloadBackend.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ async function downloadRedisBackendArchive(
5656
destDir: string,
5757
): Promise<string> {
5858
ensureFolderExists(destDir)
59-
const downloadUrl = getDownloadUrl()
59+
let downloadUrl = getDownloadUrl()
6060

6161
return new Promise((resolve, reject) => {
6262
const requestOptions: https.RequestOptions = parseUrl(downloadUrl)
6363
https.get(requestOptions, (res) => {
64-
if (res.statusCode !== 200) {
64+
if (res.statusCode === 302 && res.headers.location) {
65+
downloadUrl = res.headers.location
66+
} else if (res.statusCode !== 200) {
6567
reject(new Error('Failed to get Redis Insight backend archive location'))
6668
}
6769

0 commit comments

Comments
 (0)