Improve git-prompt compilation error message
This commit is contained in:
parent
35942cdc09
commit
37480288ae
@ -122,9 +122,10 @@ visible_length() {
|
||||
compile_git_prompt() {
|
||||
# Compile a simple C executable which parses the output of `git status
|
||||
# --procelain` to greatly decrease the time taken to render the prompt
|
||||
if [ ! -d ~/.cache/zsh ]; then mkdir -p ~/.cache/zsh; fi
|
||||
if [ ! -f ~/.cache/zsh/git-prompt ]; then
|
||||
cc -x c -std=gnu99 -O3 -DNDEBUG -o ~/.cache/zsh/git-prompt - << EOF
|
||||
local cache=~/.cache/zsh
|
||||
if [ ! -d $cache ]; then mkdir -p $cache; fi
|
||||
if [ ! -f $cache/git-prompt ]; then
|
||||
cc -x c -std=gnu99 -O3 -DNDEBUG -o $cache/git-prompt - 2> /dev/null << EOF
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -176,6 +177,9 @@ int main() {
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "git prompt disabled, are the system development headers installed?"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user