Skip to content

Commit 4c2ec40

Browse files
authored
Merge pull request #978 from amiaopensource/recording-dir-processes
only grab metadata about recording dir if it exists
2 parents 65a625b + e3aad06 commit 4c2ec40

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

vrecord

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3096,22 +3096,24 @@ _writeingestlog "operating_system_VERSION" "$(uname -v)"
30963096
_writeingestlog "vrecord version" "${VERSION}"
30973097
_writeingestlog "datetime_start" "$(_get_iso8601)"
30983098

3099-
MOUNT_PATH="$(df -Ph "${DIR}" 2>/dev/null | tail -n 1 | awk '{print $6}')"
3100-
if [[ "${OS_TYPE}" = "macOS" ]] ; then
3101-
VOLUME_INFO="$(diskutil info "${MOUNT_PATH}")"
3102-
PART_OF_WHOLE="/dev/$(_parse_report "Part of Whole" "${VOLUME_INFO}")"
3103-
CAPTURE_DEVICE_INFO="$(diskutil info "${PART_OF_WHOLE}")"
3104-
3105-
_writeingestlog "capture_device_node" "$(_parse_report "Device Node" "${CAPTURE_DEVICE_INFO}")"
3106-
_writeingestlog "capture_device_protocol" "$(_parse_report "Protocol" "${CAPTURE_DEVICE_INFO}")"
3107-
_writeingestlog "capture_device_name" "$(_parse_report "Device / Media Name" "${CAPTURE_DEVICE_INFO}")"
3108-
_writeingestlog "capture_device_block_size" "$(_parse_report "Device Block Size" "${CAPTURE_DEVICE_INFO}")"
3109-
_writeingestlog "capture_device_location" "$(_parse_report "Device Location" "${CAPTURE_DEVICE_INFO}")"
3110-
_writeingestlog "capture_device_partition_type" "$(_parse_report "Partition Type" "${VOLUME_INFO}")"
3111-
_writeingestlog "capture_device_partition_name" "$(_parse_report "Name (User Visible)" "${VOLUME_INFO}")"
3112-
_writeingestlog "capture_device_volume_uuid" "$(_parse_report "Volume UUID" "${VOLUME_INFO}")"
3113-
_writeingestlog "capture_device_volume_available" "$(_parse_report "Volume Available Space" "${VOLUME_INFO}")"
3114-
_writeingestlog "capture_device_volume_total" "$(_parse_report "Volume Total Space" "${VOLUME_INFO}")"
3099+
if [[ -d "${DIR}" ]] ; then
3100+
MOUNT_PATH="$(df -Ph "${DIR}" 2>/dev/null | tail -n 1 | awk '{print $6}')"
3101+
if [[ "${OS_TYPE}" = "macOS" ]] ; then
3102+
VOLUME_INFO="$(diskutil info "${MOUNT_PATH}")"
3103+
PART_OF_WHOLE="/dev/$(_parse_report "Part of Whole" "${VOLUME_INFO}")"
3104+
CAPTURE_DEVICE_INFO="$(diskutil info "${PART_OF_WHOLE}")"
3105+
3106+
_writeingestlog "capture_device_node" "$(_parse_report "Device Node" "${CAPTURE_DEVICE_INFO}")"
3107+
_writeingestlog "capture_device_protocol" "$(_parse_report "Protocol" "${CAPTURE_DEVICE_INFO}")"
3108+
_writeingestlog "capture_device_name" "$(_parse_report "Device / Media Name" "${CAPTURE_DEVICE_INFO}")"
3109+
_writeingestlog "capture_device_block_size" "$(_parse_report "Device Block Size" "${CAPTURE_DEVICE_INFO}")"
3110+
_writeingestlog "capture_device_location" "$(_parse_report "Device Location" "${CAPTURE_DEVICE_INFO}")"
3111+
_writeingestlog "capture_device_partition_type" "$(_parse_report "Partition Type" "${VOLUME_INFO}")"
3112+
_writeingestlog "capture_device_partition_name" "$(_parse_report "Name (User Visible)" "${VOLUME_INFO}")"
3113+
_writeingestlog "capture_device_volume_uuid" "$(_parse_report "Volume UUID" "${VOLUME_INFO}")"
3114+
_writeingestlog "capture_device_volume_available" "$(_parse_report "Volume Available Space" "${VOLUME_INFO}")"
3115+
_writeingestlog "capture_device_volume_total" "$(_parse_report "Volume Total Space" "${VOLUME_INFO}")"
3116+
fi
31153117
fi
31163118

31173119
_writeingestlog "FILE_PATH" "${VRECORD_OUTPUT}"

0 commit comments

Comments
 (0)