LukeSmithxyz / LARBS

Luke's Auto-Rice Bootstrapping Scripts: Installation Scripts for My Arch Linux Meta-Distribution
GNU General Public License v3.0
2.03k stars 798 forks source link

Optimization and best-practice #501

Closed calebrwalk5 closed 1 year ago

calebrwalk5 commented 1 year ago

Changes

use #!/usr/bin/env bash instead of #!/bin/sh
use set -euo pipefail to enable strict error handling
printf instead of echo because printf is more reliable
Use 2>&1 instead of >/dev/null to redirect both stdout and stderr to the same location
Use || exit 1 instead of >/dev/null 2>&1 to handle command failures. This will cause the script to exit with a non-zero exit code if the command fails. Instead of just ignoring the error.
Misc. optimizations