Skip to content

Commit 51316ba

Browse files
authored
fix: remote-cache list returninig undefined instead of empty (#338)
* fix: remote-cache list returninig undefined instead of empty * changeset
1 parent 4973d5d commit 51316ba

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.changeset/fifty-items-shop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rnef/cli': patch
3+
---
4+
5+
fix: remote-cache list returninig undefined instead of empty

packages/cli/src/lib/plugins/remoteCache.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,14 @@ async function remoteCache({
5757
switch (action) {
5858
case 'list': {
5959
const artifacts = await remoteBuildCache.list({ artifactName });
60-
if (artifacts) {
60+
const artifact = artifacts[0];
61+
if (artifact) {
6162
if (isJsonOutput) {
62-
console.log(JSON.stringify(artifacts[0], null, 2));
63+
console.log(JSON.stringify(artifact, null, 2));
6364
} else {
64-
logger.log(`- name: ${artifacts[0].name}
65-
- url: ${artifacts[0].url}`);
65+
logger.log(`- name: ${artifact.name}
66+
- url: ${artifact.url}`);
6667
}
67-
} else {
68-
throw new RnefError(`No artifacts found for "${artifactName}".`);
6968
}
7069
break;
7170
}

0 commit comments

Comments
 (0)