Skip to content
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

Merged
merged 3 commits into from Dec 1, 2016
Merged

Throw an error when the provided path is not an asset catalog #217

merged 3 commits into from Dec 1, 2016

Conversation

djbe
Copy link
Member

@djbe djbe commented Nov 29, 2016

Title says it all.

parser.parseCatalog(at: path)

switch path.extension {
case "xcassets"?:
Copy link
Collaborator

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 {
Copy link
Collaborator

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?)

Copy link
Member Author

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 😅

@kylef kylef mentioned this pull request Dec 1, 2016
@djbe djbe merged commit 4d23ed7 into SwiftGen:master Dec 1, 2016
@AliSoftware
Copy link
Collaborator

Oh is Travis starting to finally waking up? (So frustrating to wait for the CI so long!)

@djbe
Copy link
Member Author

djbe commented Dec 1, 2016

Yeah, they probably had an enormous backlog of jobs to get through.

@djbe djbe deleted the feature/catalog-folder-error branch December 1, 2016 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants