From a96aa6a409459cb50d87ea41e16f5e9a42621a59 Mon Sep 17 00:00:00 2001 From: ryleu <69326171+ryleu@users.noreply.github.com> Date: Sun, 12 Apr 2026 11:58:54 -0500 Subject: [PATCH] style: reformat with shfmt --- auto_start/auto_start_anchor.sh | 10 +++++----- auto_start/auto_start_headless_full.sh | 11 +++++------ auto_start/start_rosbag.sh | 17 ++++++++--------- treefmt.nix | 3 ++- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/auto_start/auto_start_anchor.sh b/auto_start/auto_start_anchor.sh index 9eebc57..96fb7ad 100755 --- a/auto_start/auto_start_anchor.sh +++ b/auto_start/auto_start_anchor.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash 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) while ! ip link show | grep -q "state UP"; do - echo "[INFO] Waiting for active network interface..." - sleep 1 + echo "[INFO] Waiting for active network interface..." + sleep 1 done echo "[INFO] Network interface is up!" @@ -16,9 +16,9 @@ echo "[INFO] Starting ROS node..." # Source ROS 2 Humble setup script if command -v nixos-rebuild; then - echo "[INFO] running on NixOS" + echo "[INFO] running on NixOS" else - source /opt/ros/humble/setup.bash + source /opt/ros/humble/setup.bash fi # Source your workspace setup script diff --git a/auto_start/auto_start_headless_full.sh b/auto_start/auto_start_headless_full.sh index 8fb6e25..db5c76c 100755 --- a/auto_start/auto_start_headless_full.sh +++ b/auto_start/auto_start_headless_full.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash 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) while ! ip link show | grep -q "state UP"; do - echo "[INFO] Waiting for active network interface..." - sleep 1 + echo "[INFO] Waiting for active network interface..." + sleep 1 done echo "[INFO] Network interface is up!" @@ -16,9 +16,9 @@ echo "[INFO] Starting ROS node..." # Source ROS 2 Humble setup script if command -v nixos-rebuild; then - echo "[INFO] running on NixOS" + echo "[INFO] running on NixOS" else - source /opt/ros/humble/setup.bash + source /opt/ros/humble/setup.bash fi # Source your workspace setup script @@ -26,4 +26,3 @@ source $SCRIPT_DIR/../install/setup.bash # Launch the ROS 2 node ros2 run headless_pkg headless_full - diff --git a/auto_start/start_rosbag.sh b/auto_start/start_rosbag.sh index ac00fa0..8512486 100755 --- a/auto_start/start_rosbag.sh +++ b/auto_start/start_rosbag.sh @@ -1,26 +1,25 @@ #!/usr/bin/env bash 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 "$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 - echo "[INFO] Waiting for active network interface..." - sleep 1 + echo "[INFO] Waiting for active network interface..." + sleep 1 done echo "[INFO] Network interface is up!" - if command -v nixos-rebuild; then - echo "[INFO] running on NixOS" + echo "[INFO] running on NixOS" else - source /opt/ros/humble/setup.bash + source /opt/ros/humble/setup.bash fi source $ANCHOR_WS/install/setup.bash [[ -f $AUTONOMY_WS/install/setup.bash ]] && source $AUTONOMY_WS/install/setup.bash diff --git a/treefmt.nix b/treefmt.nix index 6bd693c..34578c5 100644 --- a/treefmt.nix +++ b/treefmt.nix @@ -1,8 +1,9 @@ -{ pkgs, ... }: +{ ... }: { projectRootFile = "flake.nix"; programs = { nixfmt.enable = true; black.enable = true; + shfmt.enable = true; }; }