From 5b5395e0f48023b8dc750574e3573ebeef3162dc Mon Sep 17 00:00:00 2001 From: clsty Date: Tue, 27 Feb 2024 08:19:33 +0800 Subject: [PATCH] Fix typo;Better detect logic --- install.sh | 10 +++++----- scriptdata/installers | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 8b2a1d02a..eb9f62378 100755 --- a/install.sh +++ b/install.sh @@ -128,13 +128,13 @@ else ask_bibata=true fi if $ask_bibata;then showfun install-bibata;v install-bibata;fi -if $(test -d /usr/local/bin/LaTex); then - echo -e "\e[33m[$0]: Program \"MicroTex\" already exists, no need to install.\e[0m" +if command -v LaTeX >/dev/null 2>&1;then + echo -e "\e[33m[$0]: Program \"MicroTeX\" already exists, no need to install.\e[0m" echo -e "\e[34mYou can reinstall it in order to update to the latest version anyway.\e[0m" - ask_MicroTex=$ask -else ask_MicroTex=true + ask_MicroTeX=$ask +else ask_MicroTeX=true fi -if $ask_MicroTex;then showfun install-MicroTex;v install-MicroTex;fi +if $ask_MicroTeX;then showfun install-MicroTeX;v install-MicroTeX;fi ##################################################################################### printf "\e[36m[$0]: 3. Copying\e[97m\n" diff --git a/scriptdata/installers b/scriptdata/installers index aad02b94f..8d2fe7bab 100644 --- a/scriptdata/installers +++ b/scriptdata/installers @@ -87,9 +87,9 @@ install-bibata (){ x cd $base } -install-MicroTex (){ - x mkdir -p $base/cache/MicroTex - x cd $base/cache/MicroTex +install-MicroTeX (){ + x mkdir -p $base/cache/MicroTeX + x cd $base/cache/MicroTeX try git init -b master try git remote add origin https://github.com/NanoMichael/MicroTeX.git x git pull origin master && git submodule update --init --recursive