Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_settings_link(): use settings() #2757

Merged
merged 1 commit into from
Jun 8, 2023
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
8 changes: 4 additions & 4 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,13 @@ function get_links()
function check_settings_link()
{
local FULL_FILE FILE DIRNAME SETTINGS_LINK RET MSG F E CORRECT_NAME
FULL_FILE="$1"
FULL_FILE="${1}"
if [[ -z ${FULL_FILE} ]]; then
echo "check_settings_link(): Settings file not specified."
return 1
fi
[[ -z ${CAMERA_TYPE} ]] && CAMERA_TYPE="$( jq -r ".cameraType" "${FULL_FILE}" )"
[[ -z ${CAMERA_MODEL} ]] && CAMERA_MODEL="$( jq -r ".cameraModel" "${FULL_FILE}" )"
[[ -z ${CAMERA_TYPE} ]] && CAMERA_TYPE="$( settings .cameraType "${FULL_FILE}" )"
[[ -z ${CAMERA_MODEL} ]] && CAMERA_MODEL="$( settings .cameraModel "${FULL_FILE}" )"

DIRNAME="$( dirname "${FULL_FILE}" )"
FILE="$( basename "${FULL_FILE}" )"
Expand All @@ -521,7 +521,7 @@ function check_settings_link()
else
# Make sure it's linked to the correct file.
if [[ ${SETTINGS_LINK} != "${FULL_CORRECT_NAME}" ]]; then
MSG="The settings file (${FILE}) was linked to:"
MSG="The settings file (${FULL_FILE}) was linked to:"
MSG="${MSG}\n ${SETTINGS_LINK}"
MSG="${MSG}\nbut should have been linked to:"
MSG="${MSG}\n ${FULL_CORRECT_NAME}"
Expand Down