From 521f68b8b7f8e765b0f0a4cc94d6f39341b59b1d Mon Sep 17 00:00:00 2001 From: Jonas Bernard Date: Wed, 14 Sep 2022 02:47:49 +0200 Subject: [PATCH] Update CI pipeline to not commit empty files --- ci/import_translations.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ci/import_translations.js b/ci/import_translations.js index e3cd6ed..5ac3919 100644 --- a/ci/import_translations.js +++ b/ci/import_translations.js @@ -51,7 +51,20 @@ async function downloadTo(https, fs, fse, url, path) { // after download completed close filestream file.on("finish", () => { file.close(); - console.log("Download completed for url: " + url + " to " + path); + console.log("Download completed from url " + url + " to " + path); + + // If file is empty, delete it again as gradle build will fail otherwise + fs.readFile(path, function(err, data) { + if (data.length == 0) { + fs.unlink(path, (err) => { + if (err) { + console.log(err); + } + console.log('Deleted file ' + path + "again as it was empty."); + }) + } + }) + resolve(); }); });