fix: Fix flag ordering in set calls in scripts (#99)

The README for scripts has an incorrect use of the `set`. Where it says
to use:

	set -oue pipefail

it should be:

	set -euo pipefail

since `pipefail` is an option consumed by `set -o`.

More information: https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
This commit is contained in:
Nick Saika 2024-01-16 01:12:08 -05:00 committed by GitHub
parent e530978bb4
commit 17bacbe3da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 25 additions and 25 deletions

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -oue pipefail
set -euo pipefail
function ENABLE_MULTIMEDIA_REPO {
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo && sed -i "0,/enabled/ s@enabled=0@enabled=1@g" /etc/yum.repos.d/negativo17-fedora-multimedia.repo;

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
# Fetch bling COPR
REPO="https://copr.fedorainfracloud.org/coprs/ublue-os/bling/repo/fedora-${OS_VERSION}/ublue-os-bling-fedora-${OS_VERSION}.repo"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
install -c -m 0755 "$BLING_DIRECTORY/files/usr/bin/docker-compose" "/usr/bin/docker-compose"
install -c -m 0755 "$BLING_DIRECTORY/files/usr/bin/kind" "/usr/bin/kind"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
cp -r "$BLING_DIRECTORY/files/usr/lib/systemd/system/dconf-update.service" "/usr/lib/systemd/system/dconf-update.service"
systemctl enable dconf-update.service

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
rpm-ostree install "$BLING_DIRECTORY"/rpms/devpod*.rpm

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -oue pipefail
set -euo pipefail
SYSTEMD_USER_JOBS_DIR="/usr/lib/systemd/user/"

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
echo "!!!!! The bling font installer has been deprecated in favor of the fonts module. This error-free message will be removed in a future version. !!!!! "

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
wget -O "/etc/yum.repos.d/_copr_kylegospo-gnome-vrr.repo" "https://copr.fedorainfracloud.org/coprs/kylegospo/gnome-vrr/repo/fedora-${OS_VERSION}/kylegospo-gnome-vrr-fedora-${OS_VERSION}.repo"

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
cp -r "$BLING_DIRECTORY"/files/usr/share/ublue-os/just/* "/usr/share/ublue-os/just"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
wget "https://copr.fedorainfracloud.org/coprs/ublue-os/staging/repo/fedora-$(rpm -E %fedora)/ublue-os-staging-fedora-$(rpm -E %fedora).repo" \
-O "/etc/yum.repos.d/_copr_ublue-os_staging.repo"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
cp "$BLING_DIRECTORY/files/usr/bin/ublue-nix-install" "/usr/bin/ublue-nix-install"
cp "$BLING_DIRECTORY/files/usr/bin/ublue-nix-uninstall" "/usr/bin/ublue-nix-uninstall"

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
rpm-ostree install "$BLING_DIRECTORY"/rpms/ublue-os-wallpapers*.rpm

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
get_config_value() {
sed -n '/^'"$1"'=/{s/'"$1"'=//;p}' "$2"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
BLING_DIRECTORY="${BLING_DIRECTORY:-"/tmp/bling"}"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
get_yaml_array FILES '.files[]' "$1"

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -oue pipefail
set -euo pipefail
NAME=$1
FORMAT=$2

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -oue pipefail
set -euo pipefail
export FONTS_MODULE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -oue pipefail
set -euo pipefail
mapfile -t FONTS <<< "$@"
URL="https://fonts.google.com/download?family="

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -oue pipefail
set -euo pipefail
mapfile -t FONTS <<< "$@"
URL="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
# Pull in repos
get_yaml_array REPOS '.repos[]' "$1"

View file

@ -22,5 +22,5 @@ When creating a script, please make sure
- `autorun.sh` only executes files that match `*.sh`.
- ...it starts with a [shebang](<https://en.wikipedia.org/wiki/Shebang_(Unix)>) like `#!/usr/bin/env bash`.
- This ensures the script is ran with the correct interpreter / shell.
- ...it contains the command `set -oue pipefail` near the start.
- ...it contains the command `set -euo pipefail` near the start.
- This will make the image build fail if your script fails. If you do not care if your script works or not, you can omit this line.

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
get_yaml_array SCRIPTS '.scripts[]' "$1"
@ -13,4 +13,4 @@ find "$PWD" -type f -exec chmod +x {} \;
for SCRIPT in "${SCRIPTS[@]}"; do
echo "Running script $SCRIPT"
eval "$PWD/$SCRIPT"
done
done

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
get_yaml_array ENABLED '.system.enabled[]' "$1"
get_yaml_array DISABLED '.system.disabled[]' "$1"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
set -oue pipefail
set -euo pipefail
FIRSTBOOT_DATA="/usr/share/ublue-os/firstboot"
FIRSTBOOT_SCRIPT="${FIRSTBOOT_DATA}/launcher/login-profile.sh"