Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

set -e # Exit on error
###############################################################################
# Build the project using CMake
#
# Builds in Debug mode by default and installs to the install/ directory.
#
# Usage:
# ./scripts/build.sh
###############################################################################

# Set build directory
BUILD_DIR="build"
Expand Down
14 changes: 11 additions & 3 deletions scripts/coverage.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash

set -e # Exit on error
#!/usr/bin/env bash
set -e

###############################################################################
# Build and run code coverage analysis
#
# Builds with coverage enabled, runs tests, and generates HTML coverage report.
#
# Usage:
# ./scripts/coverage.sh
###############################################################################

# Set build directory
BUILD_DIR="build"
Expand Down
13 changes: 9 additions & 4 deletions scripts/docker/attach.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/usr/bin/env bash
set -e

# ------------------------------------------------------------------------------
# Attach to the running cpp-dev container as 'ubuntu' (remapped UID/GID)
# Fails if the container is not running (expected behavior).
# ------------------------------------------------------------------------------
###############################################################################
# Attach to the running cpp-dev container
#
# Attaches to the running container as 'ubuntu' user (remapped UID/GID).
# Fails if the container is not running.
#
# Usage:
# ./scripts/docker/attach.sh
###############################################################################

CONTAINER_NAME="cpp-dev-${USER}"

Expand Down
Empty file modified scripts/docker/build_image.sh
100644 → 100755
Empty file.
14 changes: 13 additions & 1 deletion scripts/docker/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

###############################################################################
# Docker entrypoint script for UID/GID remapping
#
# Remaps the ubuntu user's UID/GID at runtime to match the host user.
# This ensures proper file permissions for mounted volumes.
#
# Environment variables:
# HOST_UID - Host user ID to remap to (default: 1000)
# HOST_GID - Host group ID to remap to (default: 1000)
###############################################################################

# Get host UID/GID from environment (defaults to 1000 if not set)
HOST_UID=${HOST_UID:-1000}
HOST_GID=${HOST_GID:-1000}

# Container user (hardcoded to 'ubuntu' to match Ubuntu base image convention)
CONTAINER_USER=ubuntu

echo "Remapping '$CONTAINER_USER' to UID=$HOST_UID, GID=$HOST_GID"
Expand Down
13 changes: 9 additions & 4 deletions scripts/docker/run.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/usr/bin/env bash
set -e

# ------------------------------------------------------------------------------
# Run the prebuilt cpp-dev Docker image interactively
# Passes host UID/GID for runtime remapping (matches DevContainer behavior)
# ------------------------------------------------------------------------------
###############################################################################
# Run the cpp-dev Docker image interactively
#
# Runs the prebuilt cpp-dev image with host UID/GID remapping.
# Matches DevContainer behavior for consistent file permissions.
#
# Usage:
# ./scripts/docker/run.sh
###############################################################################
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
PROJECT_NAME="$(basename "$PROJECT_ROOT")"
Expand Down
9 changes: 9 additions & 0 deletions scripts/docs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/usr/bin/env bash
set -e

###############################################################################
# Generate Doxygen documentation
#
# Generates HTML documentation from source code comments.
#
# Usage:
# ./scripts/docs.sh
###############################################################################

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
DOCS_DIR="${PROJECT_ROOT}/docs"
Expand Down
18 changes: 10 additions & 8 deletions scripts/format.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

# --------------------------------------------------------------------
# Format all C++ source/header files in the project using clang-format
###############################################################################
# Format all C++ source/header files using clang-format
#
# Formats all C++ files in the project according to .clang-format config.
#
# Usage:
# ./format.sh - Format files in-place
# ./format.sh --check - Check formatting without modifying files
# --------------------------------------------------------------------

set -e
# ./scripts/format.sh - Format files in-place
# ./scripts/format.sh --check - Check formatting without modifying files
###############################################################################

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
Expand Down
11 changes: 8 additions & 3 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#!/usr/bin/env bash
set -e

# ------------------------------------------------------------------------------
# Run clang-tidy over all C++ source files using the build compile_commands.json
# ------------------------------------------------------------------------------
###############################################################################
# Run clang-tidy static analysis
#
# Runs clang-tidy over all C++ source files using compile_commands.json.
#
# Usage:
# ./scripts/lint.sh
###############################################################################

BUILD_DIR="build"
TIDY_BIN=$(command -v clang-tidy || true)
Expand Down
14 changes: 11 additions & 3 deletions scripts/package.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash

set -e # Exit on error
#!/usr/bin/env bash
set -e

###############################################################################
# Package the project for distribution
#
# Builds in Release mode and creates distributable packages.
#
# Usage:
# ./scripts/package.sh
###############################################################################

# Set build directory
BUILD_DIR="build"
Expand Down