-
Notifications
You must be signed in to change notification settings - Fork 43
Description
STORAGE_DIR is removed after build, however it is shared between instances. If I'm processing a and b at the same time, bitmaps added to b will be lost after a.build().
sketch-constructor/models/Sketch/Sketch.js
Line 176 in c945f56
| fs.removeSync(STORAGE_DIR); |
We may use os.tmpdir() if the directory is used temporarily. For developers who want to control the storage (like me π), they can specify the STORAGE_DIR environment and clean up manually.
| const fileHash = md5File.sync(args.filePath); |
The filename of a bitmap looks like a sha1 hash because it has 160bit length (40 * 0~f). But it's different from the sha1 of original image or the image inside sketch file, so I don't know how it is generated exactly (maybe it doesn't matter).
I wonder whether images from different sketch file can get conflicted (different bitmap with the same filename)? Or we can just assume that different image has a different filename?
BitmapLayer is exported from 'bitmap/index.d.ts', which is not the same as 'bitmap/index.js'
| export interface BitmapLayer { |
It should be the declaration for 'index.js' like declare class Bitmap { ... }
I checked some of my sketch files and didn't find any layers with _class: bitmapLayer (and not found in sketch-hq/sketch-file-format). Is there anything I've missed, or just some mistakes?