Closed V01dZer0 closed 8 years ago
@travisjeffery new pull request has been created for oh-my-zsh crash fix.
can we not ignore the workspace? also what's the behavior now for oh-my-zsh users? just uses the bundled version of clang-format?
@travisjeffery
xcworkspace is not under version control before, so each time enter 'git status' command, git will notice me there are untracked file under project.xcworkspace, that makes me feel the project unclean.
There are 3 file/folders in it (as described here)
I didn't change the behaviour when the extension use clang-format in bundle or the system installed one, just fix this problem:
when execute command 'which clang-format', and no clang-format installed to system, oh-my-zsh will return string 'clang-format not found' , instead of an empty string in bash. The extension will use the 'clang-format not found' string as the system clang-format path to start an NSTask, this will raise an exception and not catched, then the Xcode crashes.
So this commit will decide if the 'which clang-format' returned string is really a file path, or a warning noticed by shell. Use clang-format in bundle if the users didn't installed clang-format by themselves, otherwise use the user installed one, this is same as before.
Many of my friends use oh-my-zsh, but seldom install a clang-format by themselves.
oh-my-zsh is a very popular and powerful shell for mac, you may want to try it, and this line is not an advertisement : )
@travisjeffery And the crash stack is here: https://github.com/travisjeffery/ClangFormat-Xcode/issues/99
Fixed a crash with oh-my-zsh, whose 'which clang-format' command returns 'clang-format not found', instead of an empty string.
Fixed a logic error: abs(unsigned long - unsigned long) doesn't make sense.
git ignore file added xcworkspace