particle-os-modules/modules/bling/bling.sh
Nick Saika 17bacbe3da
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
2024-01-16 06:12:08 +00:00

26 lines
719 B
Bash

#!/usr/bin/env bash
# Tell build process to exit if there are any errors.
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"
wget "${REPO//[$'\t\r\n ']}" -P "/etc/yum.repos.d/"
get_yaml_array INSTALL '.install[]' "$1"
export BLING_DIRECTORY="/tmp/bling"
cd "/tmp/modules/bling/installers"
# Make every bling installer executable
find "$PWD" -type f -exec chmod +x {} \;
for ITEM in "${INSTALL[@]}"; do
echo "Pulling from bling: $ITEM"
# The trainling newline from $ITEM is removed
eval "$PWD/${ITEM%$'\n'}.sh"
done
# Remove bling COPR
rm /etc/yum.repos.d/ublue-os-bling-fedora-*.repo