Throw an error when the provided path is not an asset catalog#217
Merged
djbe merged 3 commits intoSwiftGen:masterfrom Dec 1, 2016
djbe:feature/catalog-folder-error
Merged
Throw an error when the provided path is not an asset catalog#217djbe merged 3 commits intoSwiftGen:masterfrom djbe:feature/catalog-folder-error
djbe merged 3 commits intoSwiftGen:masterfrom
djbe:feature/catalog-folder-error
Conversation
AliSoftware
reviewed
Nov 29, 2016
swiftgen-cli/images.swift
Outdated
| parser.parseCatalog(at: path) | ||
|
|
||
| switch path.extension { | ||
| case "xcassets"?: |
Collaborator
There was a problem hiding this comment.
Wouldn't an if/else be more simple here instead of switch with only one case?
AliSoftware
reviewed
Nov 29, 2016
swiftgen-cli/images.swift
Outdated
| case "xcassets"?: | ||
| parser.parseCatalog(at: path) | ||
| default: | ||
| guard let `extension` = path.extension, `extension` == "xcassets" else { |
Collaborator
There was a problem hiding this comment.
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?)
Member
Author
There was a problem hiding this comment.
Ha, no, you're right, for some reason I automatically write unwrap code 😅
AliSoftware
approved these changes
Nov 29, 2016
Merged
Collaborator
|
Oh is Travis starting to finally waking up? (So frustrating to wait for the CI so long!) |
Member
Author
|
Yeah, they probably had an enormous backlog of jobs to get through. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title says it all.