Try more previous revision to find a pre-built libGD.js

This commit is contained in:
Florian Rival
2019-04-24 21:35:33 +01:00
parent 90c3f4f72b
commit 9b5a6d8bf0

View File

@@ -101,25 +101,29 @@ if (shell.test('-f', sourceFile)) {
});
};
// Try to download the latest libGD.js, fallback to previous or master one
// Try to download the latest libGD.js, fallback to previous or master ones
// if not found.
downloadLibGdJs('HEAD').then(onLibGdJsDownloaded, () =>
downloadLibGdJs('HEAD~1').then(onLibGdJsDownloaded, () =>
downloadLibGdJs('master').then(onLibGdJsDownloaded, () => {
if (alreadyHasLibGdJs) {
shell.echo(
` Can't download any version of libGD.js, assuming you can go ahead with the existing one.`
);
shell.exit(1);
return;
} else {
shell.echo(
`❌ Can't download any version of libGD.js, please check your internet connection.`
);
shell.exit(1);
return;
}
})
downloadLibGdJs('HEAD~2').then(onLibGdJsDownloaded, () =>
downloadLibGdJs('HEAD~3').then(onLibGdJsDownloaded, () =>
downloadLibGdJs('master').then(onLibGdJsDownloaded, () => {
if (alreadyHasLibGdJs) {
shell.echo(
` Can't download any version of libGD.js, assuming you can go ahead with the existing one.`
);
shell.exit(1);
return;
} else {
shell.echo(
`❌ Can't download any version of libGD.js, please check your internet connection.`
);
shell.exit(1);
return;
}
})
)
)
)
);
}