-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
140 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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,70 @@ | ||
# Find It 🔍 | ||
|
||
### A Work In Progress 👷 | ||
|
||
For now, support `$ tryswiftdev -f -name <value>` only. 🙏 | ||
|
||
<br /> | ||
|
||
<img src="./Images/FindIt.png"> | ||
|
||
<br /> | ||
|
||
## Example | ||
|
||
### Building your project _Pokemon_ with Xcode | ||
|
||
``` | ||
ld: framework not found sourcekitd | ||
clang: error: linker command failed with exit code 1 (use -v to see invocation) | ||
``` | ||
|
||
### 🤔 | ||
|
||
<br /> | ||
|
||
### Running your project _Pokemon_ with Xcode | ||
|
||
``` | ||
dyld: Library not loaded: @rpath/sourcekitd.framework/Versions/A/sourcekitd | ||
Referenced from: /usr/local/bin/pokemon | ||
Reason: image not found | ||
``` | ||
|
||
### 🙄 | ||
|
||
<br /> | ||
|
||
### Finding it with _tryswiftdev_ | ||
|
||
```bash | ||
$ tryswiftdev -f -name sourcekitd.framework | ||
``` | ||
|
||
``` | ||
Searching... /Applications/Xcode.app/Contents | ||
Searching... /Library/Developer | ||
Searching... /Library/Frameworks | ||
Found it! | ||
- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/sourcekitd.framework | ||
- /Library/Developer/Toolchains/swift-2.2-SNAPSHOT-2016-03-01-a.xctoolchain/usr/lib/sourcekitd.framework | ||
- /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-04-25-a.xctoolchain/usr/lib/sourcekitd.framework | ||
(Check your `Runpath Search Paths`, `Framework Search Paths`, etc.) | ||
``` | ||
|
||
### 😇 | ||
|
||
<br /> | ||
|
||
## ToDo | ||
|
||
- [ ] Error Handling | ||
- [ ] Tests | ||
|
||
etc. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 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 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 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,29 @@ | ||
let maybeHere = [ | ||
"/Applications/Xcode.app/Contents", | ||
"/Library/Developer", | ||
"/Library/Frameworks", | ||
] | ||
|
||
func findFile(targetOption option: String, targetName name: String) { | ||
print("") | ||
var existingFilePaths = [String]() | ||
maybeHere.forEach { | ||
print("Searching... \($0)") | ||
guard let outputStrings = executeCommand(argments: ["find", $0, option, name]) else { return } | ||
existingFilePaths.append(contentsOf: outputStrings) | ||
} | ||
displayResult(sources: parseToArray(source: existingFilePaths.reduce("", combine: { $0 + $1 }))) | ||
} | ||
|
||
func displayResult(sources: [String]) { | ||
print("") | ||
guard !sources.isEmpty else { | ||
print("Not found.") | ||
return | ||
} | ||
print("Found it!") | ||
print("") | ||
sources.forEach { print(" - \($0)\n") } | ||
print("") | ||
print("(Check your `Runpath Search Paths`, `Framework Search Paths`, etc.)") | ||
} |
This file contains 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 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,3 @@ | ||
func parseToArray(source: String) -> [String] { | ||
return source.characters.split(separator: "\n").map { String($0) } | ||
} |
This file contains 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 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