diff --git a/scripts/os b/scripts/os index 8e7d90a..9df90ad 100755 --- a/scripts/os +++ b/scripts/os @@ -12,7 +12,7 @@ fi createRestoreDir() { if [[ -d "${restoreDir}" ]]; then - rm -rf "${restoreDir}/*" || exit 2 + rm -rf "${restoreDir:?}/*" || exit 2 else mkdir -p "${restoreDir}" || exit 2 fi @@ -45,10 +45,9 @@ runOsHook() { "${scriptPath}/os_macos" "$hook" elif [[ "$kernel" == "Linux" ]]; then case "$DISTRO" in - ubuntu) "${scriptPath}/os_debian" "$hook";; - debian) "${scriptPath}/os_debian" "$hook";; + debian|ubuntu) "${scriptPath}/os_debian" "$hook";; fedora) "${scriptPath}/os_fedora" "$hook";; - garuda) "${scriptPath}/os_garuda" "$hook";; + arch) "${scriptPath}/os_arch" "$hook";; solus) "${scriptPath}/os_solus" "$hook";; opensuse-leap) "${scriptPath}/os_suse" "$hook";; opensuse-tumbleweed) "${scriptPath}/os_suse" "$hook";; @@ -63,10 +62,10 @@ runOsHook() { hook_before() { checkOS || exit 200 - pushd "$scriptPath" &>/dev/null + pushd "$scriptPath" &>/dev/null || exit 201 git checkout -- . git pull - popd &>/dev/null + popd &>/dev/null || exit 201 createRestoreDir || exit $? runOsHook before diff --git a/scripts/os_garuda b/scripts/os_arch similarity index 100% rename from scripts/os_garuda rename to scripts/os_arch