Create /usr/local/bin if it doesn't exists when install cli

Signed-off-by: jwcesign <jiangwei115@huawei.com>
This commit is contained in:
jwcesign 2023-02-03 16:48:02 +08:00
parent c9886a01a8
commit ba1a046c9c
1 changed files with 2 additions and 0 deletions

View File

@ -237,6 +237,8 @@ setup_binary() {
info "Installing ${INSTALL_CLI_TYPE} to ${INSTALL_LOCATION}/${INSTALL_CLI_TYPE}"
tar -xzof "${TMP_BIN}" -C "${TMP_DIR}" --no-same-owner
mkdir -p "${INSTALL_LOCATION}" &>/dev/null || sudo mkdir -p "${INSTALL_LOCATION}"
local CMD_MOVE="mv -i \"${TMP_DIR}/${INSTALL_CLI_TYPE}\" \"${INSTALL_LOCATION}\""
if [[ -w "${INSTALL_LOCATION}" ]]; then
eval "${CMD_MOVE}"