Skip to content

Commit fe37baa

Browse files
authored
fix: upload app.tar.gz with binary-path (#466)
* fix: upload app.tar.gz with binary-path * changeset
1 parent b3e7eed commit fe37baa

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.changeset/big-icons-live.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: upload app.tar.gz with binary-path

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type Flags = {
2020
json?: boolean;
2121
all?: boolean;
2222
allButLatest?: boolean;
23-
binaryPath?: string
23+
binaryPath?: string;
2424
};
2525

2626
async function remoteCache({
@@ -121,15 +121,22 @@ async function remoteCache({
121121
}
122122
case 'upload': {
123123
const localArtifactPath = getLocalArtifactPath(artifactName);
124-
const binaryPath = args.binaryPath ?? getLocalBinaryPath(localArtifactPath);
124+
const binaryPath =
125+
args.binaryPath ?? getLocalBinaryPath(localArtifactPath);
125126
if (!binaryPath) {
126127
throw new RnefError(`No binary found for "${artifactName}".`);
127128
}
128129
const zip = new AdmZip();
129-
const absoluteTarballPath = path.join(localArtifactPath, 'app.tar.gz');
130+
const absoluteTarballPath =
131+
args.binaryPath ?? path.join(localArtifactPath, 'app.tar.gz');
130132
const isAppDirectory = fs.statSync(binaryPath).isDirectory();
131133
if (isAppDirectory) {
132134
const appName = path.basename(binaryPath);
135+
if (!fs.existsSync(absoluteTarballPath)) {
136+
throw new RnefError(
137+
`No tarball found for "${artifactName}" in "${localArtifactPath}".`
138+
);
139+
}
133140
await tar.create(
134141
{
135142
file: absoluteTarballPath,

0 commit comments

Comments
 (0)