mirror of
https://github.com/SHC-ASTRA/rover-ros2.git
synced 2026-04-20 20:01:15 -05:00
set up shfmt
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||||
|
|
||||||
# Wait for a network interface to be up (not necessarily online)
|
# Wait for a network interface to be up (not necessarily online)
|
||||||
while ! ip link show | grep -q "state UP"; do
|
while ! ip link show | grep -q "state UP"; do
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||||
|
|
||||||
# Wait for a network interface to be up (not necessarily online)
|
# Wait for a network interface to be up (not necessarily online)
|
||||||
while ! ip link show | grep -q "state UP"; do
|
while ! ip link show | grep -q "state UP"; do
|
||||||
@@ -26,4 +26,3 @@ source $SCRIPT_DIR/../install/setup.bash
|
|||||||
|
|
||||||
# Launch the ROS 2 node
|
# Launch the ROS 2 node
|
||||||
ros2 run headless_pkg headless_full
|
ros2 run headless_pkg headless_full
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||||
|
|
||||||
[[ -z "$ANCHOR_WS" ]] && ANCHOR_WS="$SCRIPT_DIR/.."
|
[[ -z $ANCHOR_WS ]] && ANCHOR_WS="$SCRIPT_DIR/.."
|
||||||
[[ -z "$AUTONOMY_WS" ]] && AUTONOMY_WS="$HOME/rover-Autonomy"
|
[[ -z $AUTONOMY_WS ]] && AUTONOMY_WS="$HOME/rover-Autonomy"
|
||||||
BAG_LOCATION="$HOME/bags/autostart"
|
BAG_LOCATION="$HOME/bags/autostart"
|
||||||
[[ ! -d "$BAG_LOCATION" ]] && mkdir -p "$BAG_LOCATION"
|
[[ ! -d $BAG_LOCATION ]] && mkdir -p "$BAG_LOCATION"
|
||||||
|
|
||||||
# Wait for a network interface to be up (not necessarily online)
|
# Wait for a network interface to be up (not necessarily online)
|
||||||
while ! ip link show | grep -q "state UP"; do
|
while ! ip link show | grep -q "state UP"; do
|
||||||
@@ -16,7 +16,6 @@ done
|
|||||||
|
|
||||||
echo "[INFO] Network interface is up!"
|
echo "[INFO] Network interface is up!"
|
||||||
|
|
||||||
|
|
||||||
if command -v nixos-rebuild; then
|
if command -v nixos-rebuild; then
|
||||||
echo "[INFO] running on NixOS"
|
echo "[INFO] running on NixOS"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ cd $repo_root
|
|||||||
echo "this will nuke all of your current un-commited git changes, including any changes to submodules and any gitignored files. is this okay? (y/N)"
|
echo "this will nuke all of your current un-commited git changes, including any changes to submodules and any gitignored files. is this okay? (y/N)"
|
||||||
read okay
|
read okay
|
||||||
|
|
||||||
if [[ ! "$okay" = "y" ]]; then
|
if [[ ! $okay == "y" ]]; then
|
||||||
echo "you didn't say exactly 'y'. aborting." >&2
|
echo "you didn't say exactly 'y'. aborting." >&2
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
@@ -35,4 +35,3 @@ else
|
|||||||
echo "uhh that's not supposed to be there. this is probably a bug in this script. good luck!" >&2
|
echo "uhh that's not supposed to be there. this is probably a bug in this script. good luck!" >&2
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ test_mock_connector() {
|
|||||||
wait $ECHO_PID
|
wait $ECHO_PID
|
||||||
' 2>/dev/null) || true
|
' 2>/dev/null) || true
|
||||||
|
|
||||||
if [[ -n "$debug_output" ]] && echo "$debug_output" | grep -q "can_relay_tovic,core,50"; then
|
if [[ -n $debug_output ]] && echo "$debug_output" | grep -q "can_relay_tovic,core,50"; then
|
||||||
pass "mock connector: relay -> debug"
|
pass "mock connector: relay -> debug"
|
||||||
else
|
else
|
||||||
fail "mock connector: relay -> debug"
|
fail "mock connector: relay -> debug"
|
||||||
@@ -120,7 +120,7 @@ test_mock_connector() {
|
|||||||
wait $ECHO_PID || true
|
wait $ECHO_PID || true
|
||||||
' 2>/dev/null || true) || core_output=""
|
' 2>/dev/null || true) || core_output=""
|
||||||
|
|
||||||
if [[ -n "$core_output" ]] && echo "$core_output" | grep -q "mcu_name: core" && echo "$core_output" | grep -q "command_id: 10"; then
|
if [[ -n $core_output ]] && echo "$core_output" | grep -q "mcu_name: core" && echo "$core_output" | grep -q "command_id: 10"; then
|
||||||
pass "mock connector: mock_mcu -> from_vic/core"
|
pass "mock connector: mock_mcu -> from_vic/core"
|
||||||
else
|
else
|
||||||
fail "mock connector: mock_mcu -> from_vic/core"
|
fail "mock connector: mock_mcu -> from_vic/core"
|
||||||
@@ -138,7 +138,7 @@ test_mock_connector() {
|
|||||||
wait $ECHO_PID
|
wait $ECHO_PID
|
||||||
' 2>/dev/null) || true
|
' 2>/dev/null) || true
|
||||||
|
|
||||||
if [[ -n "$arm_output" ]] && echo "$arm_output" | grep -q "mcu_name: arm" && echo "$arm_output" | grep -q "command_id: 55"; then
|
if [[ -n $arm_output ]] && echo "$arm_output" | grep -q "mcu_name: arm" && echo "$arm_output" | grep -q "command_id: 55"; then
|
||||||
pass "mock connector: mock_mcu -> from_vic/arm"
|
pass "mock connector: mock_mcu -> from_vic/arm"
|
||||||
else
|
else
|
||||||
fail "mock connector: mock_mcu -> from_vic/arm"
|
fail "mock connector: mock_mcu -> from_vic/arm"
|
||||||
@@ -174,7 +174,7 @@ test_mock_connector() {
|
|||||||
wait $ECHO_PID
|
wait $ECHO_PID
|
||||||
' 2>/dev/null) || true
|
' 2>/dev/null) || true
|
||||||
|
|
||||||
if [[ -n "$relay_string_output" ]] && echo "$relay_string_output" | grep -q "test_raw_string_data"; then
|
if [[ -n $relay_string_output ]] && echo "$relay_string_output" | grep -q "test_raw_string_data"; then
|
||||||
pass "mock connector: relay_string -> debug"
|
pass "mock connector: relay_string -> debug"
|
||||||
else
|
else
|
||||||
fail "mock connector: relay_string -> debug"
|
fail "mock connector: relay_string -> debug"
|
||||||
@@ -230,7 +230,7 @@ test_serial_connector() {
|
|||||||
wait $ECHO_PID
|
wait $ECHO_PID
|
||||||
' 2>/dev/null) || true
|
' 2>/dev/null) || true
|
||||||
|
|
||||||
if [[ -n "$relay_string_output" ]] && echo "$relay_string_output" | grep -q "serial_test_string"; then
|
if [[ -n $relay_string_output ]] && echo "$relay_string_output" | grep -q "serial_test_string"; then
|
||||||
pass "serial connector: relay_string -> debug"
|
pass "serial connector: relay_string -> debug"
|
||||||
else
|
else
|
||||||
fail "serial connector: relay_string -> debug"
|
fail "serial connector: relay_string -> debug"
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
{ pkgs, ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
projectRootFile = "flake.nix";
|
projectRootFile = "flake.nix";
|
||||||
programs = {
|
programs = {
|
||||||
nixfmt.enable = true;
|
nixfmt.enable = true;
|
||||||
black.enable = true;
|
black.enable = true;
|
||||||
|
shfmt.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user