Open vegerot opened 3 years ago
edit: nvm, 👇 error is just because svgexport
adds event listeners for SIGINT
, SIGTERM
, and SIGHUP
for each render
job.
btw while I'm here, I also have another (probably unrelated) question. Even when the script is successful, my output looks like this
❯ ./tools/createIcons.mjs src/assets/My-Logo.svg public/img/icons/
(node:2404) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:2404) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:2404) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:2404) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
Which seems odd
I am trying to make a script to auto-generate icon files and send them to the right spots. This is what I have so far
However, I am having trouble diagnosing a bug in my code. Whenever I add a new size to
TARGETS
, the first time I run this script I getBut normally after running my script a second time it works without a hitch. I suspect the bug comes from
svgexport.render
resolving BEFORE the files have been moved to their output locations. ThenmoveFiles
runs before the file exists, and thus the error. This would also explain why often times running it a second time works.My question: Is this a bug in this library, or is there something I can do to my code to fix it?
Thanks