Skip to content

Commit

Permalink
Update pubsub version/md5/byte size. (#5205)
Browse files Browse the repository at this point in the history
* Update pubsub version/md5/byte size.
* Update some download logic to pause for 2s to allow the unzip to complete before chmod.
  • Loading branch information
christhompsongoogle committed Nov 9, 2022
1 parent 577bd7e commit be10d72
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,5 @@
- Updated the pubsub emulator to v0.7.1.
- Updated some emulator download logic to pause after unzipping to avoid a file not found issue.
- Fixes gzipped file handling in Storage Emulator.
- Add support for object list using certain Admin SDKs (#5208)
- Fixes source token expiration issue by acquiring new source token upon expiration.
Expand Down
6 changes: 5 additions & 1 deletion src/emulator/download.ts
Expand Up @@ -37,6 +37,10 @@ export async function downloadEmulator(name: DownloadableEmulators): Promise<voi
await unzip(emulator.downloadPath, emulator.unzipDir);
}

// Set a delay while the unzip stream completes before running chmod
// See https://github.com/ZJONSSON/node-unzipper/issues/165
await new Promise((f) => setTimeout(f, 2000));

const executablePath = emulator.binaryPath || emulator.downloadPath;
fs.chmodSync(executablePath, 0o755);

Expand Down Expand Up @@ -79,7 +83,7 @@ function unzip(zipPath: string, unzipDir: string): Promise<void> {
fs.createReadStream(zipPath)
.pipe(unzipper.Extract({ path: unzipDir })) // eslint-disable-line new-cap
.on("error", reject)
.on("finish", resolve);
.on("close", resolve);
});
}

Expand Down
6 changes: 3 additions & 3 deletions src/emulator/downloadableEmulators.ts
Expand Up @@ -50,9 +50,9 @@ const EMULATOR_UPDATE_DETAILS: { [s in DownloadableEmulators]: EmulatorUpdateDet
expectedChecksum: "a4944414518be206280b495f526f18bf",
},
pubsub: {
version: "0.1.0",
expectedSize: 36623622,
expectedChecksum: "81704b24737d4968734d3e175f4cde71",
version: "0.7.1",
expectedSize: 65137179,
expectedChecksum: "b59a6e705031a54a69e5e1dced7ca9bf",
},
};

Expand Down

0 comments on commit be10d72

Please sign in to comment.