From 8a925342cce2a7ddd5c2a46d77eabf1a2a7eaac8 Mon Sep 17 00:00:00 2001 From: xinsheng Ren <285808407@qq.com> Date: Wed, 22 Feb 2023 09:05:21 +0800 Subject: [PATCH] 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> --- packaging/tools/post.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/packaging/tools/post.sh b/packaging/tools/post.sh index 6755ed40e5..78eb7f7587 100755 --- a/packaging/tools/post.sh +++ b/packaging/tools/post.sh @@ -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 && -- GitLab