al12gamer / gpdwinlinux

READ THE README
The Unlicense
14 stars 2 forks source link

Better defaults for shell scripts #6

Closed BaldPolnareff closed 4 months ago

BaldPolnareff commented 6 months ago

I just added a couple of better defaults for the shell scripts:

  1. #!/usr/bin/env bash is usually recommended over hardcoding #!/bin/bash as some systems may have bash in different places, this trick should resolve the env with the right path to bash in general
  2. set -euo pipefail guarantees running in strict mode, in case uncaught errors occur, the scripts will exit at the failure point, rather than continuing executing the rest of the script
al12gamer commented 5 months ago

Thanks for these! Any other suggestions?