iopsys-feed/iop/scripts/genconfig_wrap.sh
2024-01-30 17:19:31 +01:00

34 lines
825 B
Bash
Executable file

#!/bin/bash
# Function to convert parameters to lowercase
function to_lowercase {
local params=()
for param in "$@"; do
params+=("$(echo "$param" | tr '[:upper:]' '[:lower:]')")
done
echo "${params[@]}"
}
function genconfig {
target_script="./scripts/gen_config.py"
# First convert all to lowercase
args=$(to_lowercase "$@")
# Check if an option is provided
if [[ ${args[0]} == -* ]]; then
# Convert options for target script
if [[ ${args[0]} == "-b" || ${args[0]} == "--boards" ]]; then
args=()
args[0]="-l"
elif [[ ${args[0]} == "-c" || ${args[0]} == "--clean" ]]; then
args=()
args[0]="-c"
fi
fi
${target_script} ${args[*]}
}
register_command "genconfig" "Generate configuration for board and customer"