enh: check if the directory exists before installing on mac (#20047)

* enh: check if the directory exists before installing on mac

* fix: check directory on different platforms

---------

Co-authored-by: facetosea <25808407@qq.com>
This commit is contained in:
xinsheng Ren 2023-02-22 09:05:21 +08:00 committed by GitHub
parent 4736636fb2
commit 8a925342cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 3 deletions

View File

@ -627,9 +627,16 @@ function install_app() {
fi
}
function install_TDengine() {
echo -e "${GREEN}Start to install TDengine...${NC}"
log_print "start to install TDengine"
function checkDirectory() {
if [ ! -d "${bin_link_dir}" ]; then
${csudo}mkdir -p ${bin_link_dir}
log_print "${bin_link_dir} directory created"
fi
if [ ! -d "${lib_link_dir}" ]; then
${csudo}mkdir -p ${lib_link_dir}
log_print "${lib_link_dir} directory created"
fi
#install log and data dir , then ln to /usr/local/taos
${csudo}mkdir -p ${log_dir} && ${csudo}chmod 777 ${log_dir}
@ -640,6 +647,13 @@ function install_TDengine() {
${csudo}ln -s ${log_dir} ${log_link_dir} || :
${csudo}ln -s ${data_dir} ${data_link_dir} || :
}
function install_TDengine() {
echo -e "${GREEN}Start to install TDengine...${NC}"
log_print "start to install TDengine"
checkDirectory
# Install include, lib, binary and service
install_include &&