49 lines
1.2 KiB
Bash
Executable File
49 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
|
|
missing_source_message="missing LinuxCNC source"
|
|
preflight_cache_dir=${CNC_SIM_PREFLIGHT_CACHE_DIR:-build/linuxcnc-helper-preflight-cache}
|
|
|
|
LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs-cached.sh --cache-dir "$preflight_cache_dir" --root-only
|
|
|
|
while [[ "$#" -gt 0 ]]; do
|
|
case "$1" in
|
|
--missing-message)
|
|
if [[ "$#" -lt 2 ]]; then
|
|
echo "missing --missing-message value" >&2
|
|
exit 1
|
|
fi
|
|
missing_source_message=$2
|
|
shift 2
|
|
;;
|
|
--)
|
|
shift
|
|
break
|
|
;;
|
|
-*)
|
|
echo "unknown source file option: $1" >&2
|
|
exit 1
|
|
;;
|
|
*)
|
|
break
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ "$#" -eq 0 ]]; then
|
|
echo "usage: $0 [--missing-message <message>] <linuxcnc-relative-source>..." >&2
|
|
exit 1
|
|
fi
|
|
|
|
for source in "$@"; do
|
|
full_source="$linuxcnc_root/$source"
|
|
if [[ ! -f "$full_source" ]]; then
|
|
echo "$missing_source_message: $source" >&2
|
|
exit 1
|
|
fi
|
|
printf '%s\n' "$full_source"
|
|
done
|