Skip to content

Commit 54ac97f

Browse files
committed
js: handle missing data dir
1 parent f777577 commit 54ac97f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

implementations/js/src/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ async function generateZarrFormat(codecIds = ["gzip", "blosc", "zlib", null]) {
3838
const path = p.join("..", "..", "data", "js.zr");
3939
const img = imread(p.join("..", "..", "data", "reference_image.png"));
4040

41-
fs.rmdirSync(path, { recursive: true, force: true });
41+
if (fs.existsSync(path)) {
42+
fs.rmdirSync(path, { recursive: true, force: true });
43+
}
44+
4245
const grp = await open(path);
4346
for (const id of codecIds) {
4447
const config = id ? STR_TO_COMPRESSOR[id] : null;

0 commit comments

Comments
 (0)