@@ -524,6 +524,15 @@ run_quiet_step() {
524524 return 1
525525}
526526
527+ run_required_step () {
528+ local title=" $1 "
529+ shift
530+ if run_quiet_step " $title " " $@ " ; then
531+ return 0
532+ fi
533+ exit 1
534+ }
535+
527536cleanup_legacy_submodules () {
528537 local repo_dir=" $1 "
529538 local legacy_dir=" $repo_dir /Peekaboo"
@@ -1747,9 +1756,9 @@ finish_linux_node_install() {
17471756install_node_with_apk () {
17481757 ui_info " Installing Node.js via apk (Alpine Linux detected)"
17491758 if is_root; then
1750- run_quiet_step " Installing Node.js" apk add --no-cache nodejs npm
1759+ run_required_step " Installing Node.js" apk add --no-cache nodejs npm
17511760 else
1752- run_quiet_step " Installing Node.js" sudo apk add --no-cache nodejs npm
1761+ run_required_step " Installing Node.js" sudo apk add --no-cache nodejs npm
17531762 fi
17541763
17551764 activate_supported_node_on_path || true
@@ -1763,9 +1772,9 @@ install_node_with_apk() {
17631772 ui_warn " Alpine nodejs package installed ${apk_node_version} , below required v${NODE_MIN_VERSION} +"
17641773 ui_info " Trying Alpine nodejs-current package"
17651774 if is_root; then
1766- run_quiet_step " Installing nodejs-current" apk add --no-cache nodejs-current npm
1775+ run_required_step " Installing nodejs-current" apk add --no-cache nodejs-current npm
17671776 else
1768- run_quiet_step " Installing nodejs-current" sudo apk add --no-cache nodejs-current npm
1777+ run_required_step " Installing nodejs-current" sudo apk add --no-cache nodejs-current npm
17691778 fi
17701779
17711780 activate_supported_node_on_path || true
@@ -1810,9 +1819,9 @@ install_node() {
18101819 if command -v pacman & > /dev/null || is_arch_linux; then
18111820 ui_info " Installing Node.js via pacman (Arch-based distribution detected)"
18121821 if is_root; then
1813- run_quiet_step " Installing Node.js" pacman -Sy --noconfirm nodejs npm
1822+ run_required_step " Installing Node.js" pacman -Sy --noconfirm nodejs npm
18141823 else
1815- run_quiet_step " Installing Node.js" sudo pacman -Sy --noconfirm nodejs npm
1824+ run_required_step " Installing Node.js" sudo pacman -Sy --noconfirm nodejs npm
18161825 fi
18171826 finish_linux_node_install
18181827 return 0
@@ -1827,35 +1836,35 @@ install_node() {
18271836 if command -v apt-get & > /dev/null; then
18281837 local tmp
18291838 tmp=" $( mktempfile) "
1830- run_quiet_step " Downloading NodeSource setup script" download_file " https://deb.nodesource.com/setup_${NODE_DEFAULT_MAJOR} .x" " $tmp "
1839+ run_required_step " Downloading NodeSource setup script" download_file " https://deb.nodesource.com/setup_${NODE_DEFAULT_MAJOR} .x" " $tmp "
18311840 if is_root; then
1832- run_quiet_step " Configuring NodeSource repository" bash " $tmp "
1833- run_quiet_step " Installing Node.js" apt_get_install nodejs
1841+ run_required_step " Configuring NodeSource repository" bash " $tmp "
1842+ run_required_step " Installing Node.js" apt_get_install nodejs
18341843 else
1835- run_quiet_step " Configuring NodeSource repository" sudo -E bash " $tmp "
1836- run_quiet_step " Installing Node.js" apt_get_install nodejs
1844+ run_required_step " Configuring NodeSource repository" sudo -E bash " $tmp "
1845+ run_required_step " Installing Node.js" apt_get_install nodejs
18371846 fi
18381847 elif command -v dnf & > /dev/null; then
18391848 local tmp
18401849 tmp=" $( mktempfile) "
1841- run_quiet_step " Downloading NodeSource setup script" download_file " https://rpm.nodesource.com/setup_${NODE_DEFAULT_MAJOR} .x" " $tmp "
1850+ run_required_step " Downloading NodeSource setup script" download_file " https://rpm.nodesource.com/setup_${NODE_DEFAULT_MAJOR} .x" " $tmp "
18421851 if is_root; then
1843- run_quiet_step " Configuring NodeSource repository" bash " $tmp "
1844- run_quiet_step " Installing Node.js" dnf install -y -q nodejs
1852+ run_required_step " Configuring NodeSource repository" bash " $tmp "
1853+ run_required_step " Installing Node.js" dnf install -y -q nodejs
18451854 else
1846- run_quiet_step " Configuring NodeSource repository" sudo bash " $tmp "
1847- run_quiet_step " Installing Node.js" sudo dnf install -y -q nodejs
1855+ run_required_step " Configuring NodeSource repository" sudo bash " $tmp "
1856+ run_required_step " Installing Node.js" sudo dnf install -y -q nodejs
18481857 fi
18491858 elif command -v yum & > /dev/null; then
18501859 local tmp
18511860 tmp=" $( mktempfile) "
1852- run_quiet_step " Downloading NodeSource setup script" download_file " https://rpm.nodesource.com/setup_${NODE_DEFAULT_MAJOR} .x" " $tmp "
1861+ run_required_step " Downloading NodeSource setup script" download_file " https://rpm.nodesource.com/setup_${NODE_DEFAULT_MAJOR} .x" " $tmp "
18531862 if is_root; then
1854- run_quiet_step " Configuring NodeSource repository" bash " $tmp "
1855- run_quiet_step " Installing Node.js" yum install -y -q nodejs
1863+ run_required_step " Configuring NodeSource repository" bash " $tmp "
1864+ run_required_step " Installing Node.js" yum install -y -q nodejs
18561865 else
1857- run_quiet_step " Configuring NodeSource repository" sudo bash " $tmp "
1858- run_quiet_step " Installing Node.js" sudo yum install -y -q nodejs
1866+ run_required_step " Configuring NodeSource repository" sudo bash " $tmp "
1867+ run_required_step " Installing Node.js" sudo yum install -y -q nodejs
18591868 fi
18601869 else
18611870 ui_error " Could not detect package manager"
0 commit comments