Skip to content

Commit be34cc2

Browse files
authored
fix missing assets when uploading to S3 (#2535)
1 parent 77225d5 commit be34cc2

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

packages/hadron-build/commands/upload.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,7 @@ async function maybePublishGitHubRelease(target) {
4343
// already published releases.
4444
await repo.updateDraftRelease(release);
4545

46-
const assets = target.assets.filter(function(asset) {
47-
// eslint-disable-next-line no-sync
48-
var exists = fs.existsSync(asset.path);
49-
if (!exists) {
50-
cli.warn(`Excluding ${asset.path} from upload because it does not exist.`);
51-
}
52-
return exists;
53-
});
54-
55-
const uploads = assets.map(
46+
const uploads = target.assets.map(
5647
async function(asset) {
5748
cli.info(`${asset.name}: upload to Github release ${releaseTag} started (path: ${asset.path}).`);
5849
await repo.uploadReleaseAsset(releaseTag, {
@@ -92,6 +83,15 @@ exports.handler = function(argv) {
9283
return;
9384
}
9485

86+
target.assets = target.assets.filter(function(asset) {
87+
// eslint-disable-next-line no-sync
88+
var exists = fs.existsSync(asset.path);
89+
if (!exists) {
90+
cli.warn(`Excluding ${asset.path} from upload because it does not exist.`);
91+
}
92+
return exists;
93+
});
94+
9595
maybePublishGitHubRelease(target)
9696
.then(() => downloadCenter.maybeUpload(target))
9797
.catch(abortIfError);

0 commit comments

Comments
 (0)