Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/bin/reprofed-apply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,23 @@ if ! check_distro_version; then
msg_error "Fedora version ${DISTRO_VERSION_ID:-unknown} is not supported."
exit 1
fi

PROFILE_NAME_VALUE=$(yq -r '.profile' "$APP_PATH"/config/config.yaml)

if [[ -z "$PROFILE_NAME_VALUE" ]]; then
msg_error "Profile is not set."
exit 1
fi

PROFILE_FILE="${APP_PATH}/profiles/${PROFILE_NAME_VALUE}.yaml"

if [ ! -f "$PROFILE_FILE" ]; then
msg_error "Profile '$PROFILE_NAME_VALUE' not found."
exit 1
fi

if ! DISTRO_VERSION_ID="$DISTRO_VERSION_ID" \
yq -e '.requires.distro_versions[] == strenv(DISTRO_VERSION_ID)' "$PROFILE_FILE"; then
msg_error "Fedora version ${DISTRO_VERSION_ID:-unknown} is not supported by the selected profile."
exit 1
fi