Skip to content

Commit

Permalink
Update CI pipeline to not commit empty files
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBernard committed Sep 14, 2022
1 parent c8015bc commit 521f68b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ci/import_translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
Expand Down

0 comments on commit 521f68b

Please sign in to comment.