From 568a44a37278c8e7ea36cf3ed4a3b7efaa6c99e6 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Wed, 6 Apr 2022 13:29:11 +0200 Subject: [PATCH] Fix script directory --- csi_camera.sh | 3 +++ usb_camera.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/csi_camera.sh b/csi_camera.sh index bf68303..f674d81 100755 --- a/csi_camera.sh +++ b/csi_camera.sh @@ -1,5 +1,8 @@ #!/bin/bash +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +cd "$SCRIPT_DIR" + set -xeo pipefail make ./camera_stream -camera-path=$(echo /dev/v4l/by-path/*.csi-video-index0) "$@" diff --git a/usb_camera.sh b/usb_camera.sh index ec2ad4e..6915826 100755 --- a/usb_camera.sh +++ b/usb_camera.sh @@ -1,5 +1,8 @@ #!/bin/bash +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +cd "$SCRIPT_DIR" + set -xeo pipefail make ./camera_stream -camera-path=$(echo /dev/v4l/by-id/usb-*-video-index0 ) "$@"