fix(addon): mqttx node engine compat + prompt formatting

- Add --ignore-engines to yarn install (web/ requires Node 18 exactly,
  but works fine with Node 22 + --openssl-legacy-provider)
- Fix prompt formatting: use read -r -p inline instead of echo + read
- Apply same prompt fix to mongo-express addon
This commit is contained in:
CanbiZ (MickLesk)
2026-04-07 13:21:57 +02:00
parent f168bfcd5a
commit c366bf4726
2 changed files with 5 additions and 8 deletions

View File

@@ -151,11 +151,9 @@ if is_installed; then
*) msg_error "Invalid input" ;;
esac
else
echo -e "${TAB}Enter MongoDB connection URL (default: mongodb://localhost:27017): "
read -r MONGO_URL_INPUT
read -r -p "Enter MongoDB connection URL (default: mongodb://localhost:27017): " MONGO_URL_INPUT
MONGO_URL="${MONGO_URL_INPUT:-mongodb://localhost:27017}"
echo -e "${TAB}Enter port number (default: ${DEFAULT_PORT}): "
read -r PORT_INPUT
read -r -p "Enter port number (default: ${DEFAULT_PORT}): " PORT_INPUT
PORT="${PORT_INPUT:-$DEFAULT_PORT}"
read -r -p "Install ${APP}? (y/n): " answer
answer="${answer//[[:space:]]/}"

View File

@@ -46,7 +46,7 @@ function install_mqttx() {
msg_info "Building ${APP}"
cd "$APP_DIR/web"
$STD yarn install --frozen-lockfile
$STD yarn install --frozen-lockfile --ignore-engines
$STD yarn build
msg_ok "Built ${APP}"
@@ -108,7 +108,7 @@ function update_mqttx() {
msg_info "Updating ${APP}"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "mqttx" "$REPO" "tarball" "latest" "$APP_DIR"
cd "$APP_DIR/web"
$STD yarn install --frozen-lockfile
$STD yarn install --frozen-lockfile --ignore-engines
$STD yarn build
systemctl reload nginx
msg_ok "${APP} updated"
@@ -127,8 +127,7 @@ if is_installed; then
*) msg_error "Invalid input" ;;
esac
else
echo -e "${TAB}Enter port number (default: ${DEFAULT_PORT}): "
read -r PORT_INPUT
read -r -p "Enter port number (default: ${DEFAULT_PORT}): " PORT_INPUT
PORT="${PORT_INPUT:-$DEFAULT_PORT}"
read -r -p "Install ${APP}? (y/n): " answer
answer="${answer//[[:space:]]/}"