DEVenv/Linux/Scripts/gcc_env.sh
2024-04-30 15:54:40 +10:00

31 lines
691 B
Bash
Executable File

#!/bin/bash
base_path="$devenver_root/GCC"
# Check for help argument
if [[ "$1" == "help" || "$1" == "" || "$1" == "--help" || "$1" == "/?" ]]; then
echo "USAGE: gcc_env.sh <version> <command>"
echo
echo "VERSIONS:"
ls "$base_path"
exit 0
fi
# Check if a version is provided
if [[ -z "$1" ]]; then
echo "Error: No version specified."
echo "USAGE: gcc_env.sh <version> <command>"
exit 1
fi
# Extract the version and remaining arguments
version="$1"
shift
remaining_args="$@"
# Execute the command
echo "[SCRIPT] Executing $remaining_args"
root_path="$base_path/$version"
PATH=${root_path}/bin:${root_path}/lib:${root_path}/include:${PATH}
$remaining_args