Commit 77c7ffd4 authored by rockyl's avatar rockyl

init

parent 3cb12a53
...@@ -65,17 +65,16 @@ export async function execute(psdFile, options) { ...@@ -65,17 +65,16 @@ export async function execute(psdFile, options) {
viewNode.type = 'image'; viewNode.type = 'image';
const uuid = generateUUID(); const uuid = generateUUID();
const fileName = Date.now().valueOf();
const ext = '.png'; const ext = '.png';
properties.source = 'asset|' + uuid; properties.source = 'asset|' + uuid;
const imageFilePath = path.join(imagesPath, fileName + ext); const imageFilePath = path.join(imagesPath, uuid + ext);
await fs.ensureDir(path.dirname(imageFilePath)); await fs.ensureDir(path.dirname(imageFilePath));
await node.origin.saveAsPng(imageFilePath); await node.origin.saveAsPng(imageFilePath);
assets.push({ assets.push({
name: fileName, name: uuid,
ext, ext,
uuid, uuid,
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment