-
Notifications
You must be signed in to change notification settings - Fork 826
Ignore normal directory with dots #397
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
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
07fbf83
Ignore normal directory names with dots
toshi0383 6073ea0
typo
toshi0383 96e9bbb
Add assets and imagests
toshi0383 80e0cbf
fix bugs
toshi0383 e883566
Add test case in SourceGeneratorTests
toshi0383 1e21b1d
Get UTI using URL's API
toshi0383 3433988
Ignore directories which treated as special file
toshi0383 6b30fbd
Merge remote-tracking branch 'origin/master' into ts-filelikedir
toshi0383 b24a7bf
Add tests for all recognized file extensions
toshi0383 6933cde
Add comment and improve code
toshi0383 0f8bc82
Add MARK
toshi0383 d6890dc
Merge remote-tracking branch 'origin/master' into ts-filelikedir
toshi0383 fd74ab1
Fix conflict
toshi0383 3aac581
Rename to isFileDirectory
toshi0383 9227503
Update CHANGELOG.md
toshi0383 4165ec8
Potentially fix CI failure
toshi0383 a6b925a
debug
toshi0383 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Foundation | ||
import PathKit | ||
|
||
extension Path { | ||
|
||
/// Treat this as a file (resource or source) instead of a normal directory. | ||
var isFileDirectory: Bool { | ||
|
||
if isFile || self.extension == nil { | ||
return false | ||
} | ||
|
||
if let uti = try! URL(fileURLWithPath: self.string) | ||
.resourceValues(forKeys: [URLResourceKey.typeIdentifierKey]) | ||
.typeIdentifier { | ||
|
||
// If uti is `public.folder` or `dyn*`, it's a normal directory in most cases. | ||
// But for example *.lproj appears to be a `public.folder`. | ||
// So make sure to filter to treat it as a special directory. | ||
print("Path.string: \(self.string), uti: \(uti)") | ||
return uti != "public.folder" && !uti.starts(with: "dyn") | ||
|
||
} | ||
|
||
return false | ||
} | ||
|
||
} |
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
Empty file.
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
Oops, something went wrong.
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.
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.
I'd like to get the performance tests in (coming shortly) so this can be tested for performance