Try using for/of instead of for/in

This commit is contained in:
Jack Boswell (boswelja)
2020-11-10 18:44:09 +13:00
parent 651ca992ef
commit 308a7485f2
4 changed files with 6 additions and 8 deletions

View File

@@ -40,7 +40,7 @@ function uploadToPlayStore(options, releaseFiles) {
// Check the 'track' for 'internalsharing', if so switch to a non-track api
if (options.track === 'internalsharing') {
core.debug("Track is Internal app sharing, switch to special upload api");
for (const releaseFile in releaseFiles) {
for (const releaseFile of releaseFiles) {
core.debug(`Uploading ${releaseFile}`);
yield uploadInternalSharingRelease(options, releaseFile).catch(reason => {
core.setFailed(reason);
@@ -61,7 +61,7 @@ function uploadToPlayStore(options, releaseFiles) {
});
// Upload artifacts to Google Play, and store their version codes
var versionCodes = new Array();
for (const releaseFile in releaseFiles) {
for (const releaseFile of releaseFiles) {
core.debug(`Uploading ${releaseFile}`);
const versionCode = yield uploadRelease(appEdit.data, options, releaseFile).catch(reason => {
core.setFailed(reason);

View File

@@ -76,8 +76,7 @@ function run() {
userFractionFloat = undefined;
}
// Check release files
core.debug(`Checking release files ${releaseFiles}`);
for (const releaseFile in releaseFiles) {
for (const releaseFile of releaseFiles) {
core.debug(`Validating ${releaseFile} exists`);
if (!fs.existsSync(releaseFile)) {
core.setFailed(`Unable to find release file @ ${releaseFile}`);