|
|
|
@ -49,6 +49,17 @@ function _pluralize_simple { |
|
|
|
## READ Functions |
|
|
|
## ============== |
|
|
|
|
|
|
|
function fetch_distro_like { |
|
|
|
if grep -qE '^ID=debian|^ID_LIKE=debian' /etc/os-release; then |
|
|
|
echo debian |
|
|
|
elif grep -qE '^ID=arch|^ID_LIKE=arch' /etc/os-release; then |
|
|
|
echo arch |
|
|
|
else |
|
|
|
echo -n 'unsupported distro: ' |
|
|
|
grep ^ID= /etc/os-release | cut -d= -f2 |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
function _confirm_destructive { |
|
|
|
local message="${1:-This cannot be undone!}" |
|
|
|
echo "⚠️ WARNING: $message" |
|
|
|
|