-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sketch): add undefined exception handler in icon generate script #5583
fix(sketch): add undefined exception handler in icon generate script #5583
Conversation
Deploy preview for carbon-components-react ready! Built with commit a3d46e7 https://deploy-preview-5583--carbon-components-react.netlify.com |
Deploy preview for carbon-elements ready! Built with commit a3d46e7 |
@@ -68,18 +68,19 @@ export function generate() { | |||
const [_type, _category, _subcategory, name, size] = parts; | |||
return name === icon && size === '32'; | |||
}); | |||
const instance = symbol.createNewInstance(); | |||
instance.frame.offset(ICON_X_OFFSET, ICON_Y_OFFSET); | |||
const instance = symbol?.createNewInstance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wild, I think we might want to fail if the symbol doesn't exist. Maybe something like:
if (!symbol) {
throw new Error(`Unable to find symbol for icon ${icon}`);
}
5733a36
to
edb3925
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 - Thanks @emyarod!
b6e0784
to
3a7a807
Compare
3a7a807
to
a3d46e7
Compare
…arbon-design-system#5583) * chore: add log script * chore: fix typo * fix(sketch): handle undefined exception
… script (carbon-design-system#5583)" This reverts commit 83b766e.
… script (carbon-design-system#5583)" This reverts commit 83b766e.
…arbon-design-system#5583) * chore: add log script * chore: fix typo * fix(sketch): handle undefined exception
Closes #5582
This PR avoid pushing
undefined
as a Layer object to Sketch in the icon page generation script and adds an npm script for viewing the development logChangelog
New
log
npm script for viewing the development logChanged
undefined
exception handler in icons/generate scriptTesting / Reviewing
carbon/packages/sketch/src/commands/icons/shared.js
to only deal with a subset of icons (either modify thestart
andend
variables to be a subset of the full icons list or directly change the slice size insymbolsToSync
)yarn build