set up shfmt

This commit is contained in:
ryleu
2026-04-10 19:53:49 -05:00
parent 760f6ddd19
commit 358380c23c
6 changed files with 275 additions and 277 deletions

View File

@@ -26,4 +26,3 @@ source $SCRIPT_DIR/../install/setup.bash
# Launch the ROS 2 node
ros2 run headless_pkg headless_full

View File

@@ -3,10 +3,10 @@ set -e
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
[[ -z "$ANCHOR_WS" ]] && ANCHOR_WS="$SCRIPT_DIR/.."
[[ -z "$AUTONOMY_WS" ]] && AUTONOMY_WS="$HOME/rover-Autonomy"
[[ -z $ANCHOR_WS ]] && ANCHOR_WS="$SCRIPT_DIR/.."
[[ -z $AUTONOMY_WS ]] && AUTONOMY_WS="$HOME/rover-Autonomy"
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)
while ! ip link show | grep -q "state UP"; do
@@ -16,7 +16,6 @@ done
echo "[INFO] Network interface is up!"
if command -v nixos-rebuild; then
echo "[INFO] running on NixOS"
else

View File

@@ -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)"
read okay
if [[ ! "$okay" = "y" ]]; then
if [[ ! $okay == "y" ]]; then
echo "you didn't say exactly 'y'. aborting." >&2
exit 2
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
exit 3
fi

View File

@@ -102,7 +102,7 @@ test_mock_connector() {
wait $ECHO_PID
' 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"
else
fail "mock connector: relay -> debug"
@@ -120,7 +120,7 @@ test_mock_connector() {
wait $ECHO_PID || true
' 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"
else
fail "mock connector: mock_mcu -> from_vic/core"
@@ -138,7 +138,7 @@ test_mock_connector() {
wait $ECHO_PID
' 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"
else
fail "mock connector: mock_mcu -> from_vic/arm"
@@ -174,7 +174,7 @@ test_mock_connector() {
wait $ECHO_PID
' 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"
else
fail "mock connector: relay_string -> debug"
@@ -230,7 +230,7 @@ test_serial_connector() {
wait $ECHO_PID
' 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"
else
fail "serial connector: relay_string -> debug"

View File

@@ -1,8 +1,9 @@
{ pkgs, ... }:
{ ... }:
{
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
black.enable = true;
shfmt.enable = true;
};
}