Ask if fzf executable already exists
This commit is contained in:
parent
606d33e77e
commit
f9f9b671c5
17
install
17
install
@ -5,8 +5,17 @@ fzf_base=`pwd`
|
|||||||
|
|
||||||
ARCHI=$(uname -sm)
|
ARCHI=$(uname -sm)
|
||||||
|
|
||||||
|
ask() {
|
||||||
|
read -p "$1 ([y]/n) " -n 1 -r
|
||||||
|
echo
|
||||||
|
[[ ! $REPLY =~ ^[Nn]$ ]]
|
||||||
|
}
|
||||||
|
|
||||||
download() {
|
download() {
|
||||||
echo "Downloading fzf executable ($1) ..."
|
echo "Downloading fzf executable ($1) ..."
|
||||||
|
if [ -x "$fzf_base"/bin/fzf ]; then
|
||||||
|
ask "- fzf already exists. Download it again?" || return 0
|
||||||
|
fi
|
||||||
mkdir -p "$fzf_base"/bin && cd "$fzf_base"/bin
|
mkdir -p "$fzf_base"/bin && cd "$fzf_base"/bin
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "- Failed to create bin directory."
|
echo "- Failed to create bin directory."
|
||||||
@ -108,15 +117,11 @@ if [ $downloaded -ne 1 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Auto-completion
|
# Auto-completion
|
||||||
read -p "Do you want to add auto-completion support? ([y]/n) " -n 1 -r
|
ask "Do you want to add auto-completion support?"
|
||||||
echo
|
|
||||||
[[ ! $REPLY =~ ^[Nn]$ ]]
|
|
||||||
auto_completion=$?
|
auto_completion=$?
|
||||||
|
|
||||||
# Key-bindings
|
# Key-bindings
|
||||||
read -p "Do you want to add key bindings? ([y]/n) " -n 1 -r
|
ask "Do you want to add key bindings?"
|
||||||
echo
|
|
||||||
[[ ! $REPLY =~ ^[Nn]$ ]]
|
|
||||||
key_bindings=$?
|
key_bindings=$?
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user