fix: fix nvim check

use the proper `command` command
fix the redirection to /dev/null
This commit is contained in:
swytch 2020-05-25 03:59:22 +02:00
parent a2ce770d2f
commit c329e263f2
3 changed files with 14 additions and 14 deletions

View File

@ -49,28 +49,28 @@ comp=get_compiler
touch makefile touch makefile
echo "BIN = main" > makefile printf "\nBIN = main" > makefile
echo "TARGETS = $targets_list" >> makefile printf "\nTARGETS = $targets_list" >> makefile
echo "" >> makefile printf "\n" >> makefile
echo "CC = $comp" >> makefile printf "\nCC = $comp" >> makefile
echo "FLAGS = -Wall -g" >> makefile printf "\nFLAGS = -Wall -g" >> makefile
echo "" >> makefile printf "\n" >> makefile
echo "all : \$(BIN)" >> makefile printf "\nall : \$(BIN)" >> makefile
echo "" >> makefile printf "\n" >> makefile
echo "\$(BIN) : \$(TARGETS)" >> makefile printf "\n\$(BIN) : \$(TARGETS)" >> makefile
echo -e "\t\$(CC) \$(TARGETS) -o \$(BIN) \$(FLAGS)" >> makefile echo -e "\t\$(CC) \$(TARGETS) -o \$(BIN) \$(FLAGS)" >> makefile
echo "" >> makefile printf "\n" >> makefile
for module in $modules_list; do for module in $modules_list; do
make_rule "$module" make_rule "$module"
done done
echo "clean :" >> makefile printf "\nclean :" >> makefile
echo -e "\trm \$(BIN) *.o vgcore.*" >> makefile echo -e "\trm \$(BIN) *.o vgcore.*" >> makefile
sed -i 's/\s$//' makefile sed -i 's/\s$//' makefile
if type "nvim" &> /dev/null; then if command -v nvim > /dev/null 2>&1; then
nvim makefile nvim makefile
else else
vim makefile vim makefile

View File

@ -33,7 +33,7 @@ else
echo '.START' >> "$1" && \ echo '.START' >> "$1" && \
# checks if neovim is intalled # checks if neovim is intalled
if type "nvim" &> /dev/null; then if command -v nvim > /dev/null 2>&1; then
nvim "$1" nvim "$1"
else else
vim "$1" vim "$1"

View File

@ -77,7 +77,7 @@ else
echo '\end{document}' >> "$1" echo '\end{document}' >> "$1"
# check if neovim is installed # check if neovim is installed
if type "nvim" &> /dev/null; then if command -v nvim > /dev/null 2>&1; then
nvim "$1" nvim "$1"
else else
vim "$1" vim "$1"