Commit a79d745a authored by rockyl's avatar rockyl

init

parent 77c7ffd4
...@@ -272,17 +272,16 @@ async function execute$1(psdFile, options) { ...@@ -272,17 +272,16 @@ async function execute$1(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,
}); });
......
This diff is collapsed.
...@@ -278,17 +278,16 @@ async function execute$1(psdFile, options) { ...@@ -278,17 +278,16 @@ async function execute$1(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,
}); });
......
This diff is collapsed.
...@@ -278,17 +278,16 @@ ...@@ -278,17 +278,16 @@
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,
}); });
......
This diff is collapsed.
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