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
Throw an error when the provided path is not an asset catalog #217
Conversation
parser.parseCatalog(at: path) | ||
|
||
switch path.extension { | ||
case "xcassets"?: |
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.
Wouldn't an if/else be more simple here instead of switch with only one case?
case "xcassets"?: | ||
parser.parseCatalog(at: path) | ||
default: | ||
guard let `extension` = path.extension, `extension` == "xcassets" else { |
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.
Haha I was more thinking about guard case "xcassets"? = path.extension
but that works too 😄
(I'm guessing a simple guard path.extension == "xcassets"
doesn't work in Swift 3 since Optional<String> == String
doesn't work directly?)
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.
Ha, no, you're right, for some reason I automatically write unwrap code 😅
Oh is Travis starting to finally waking up? (So frustrating to wait for the CI so long!) |
Yeah, they probably had an enormous backlog of jobs to get through. |
Title says it all.