I am passing an argument to a Makefile routine, and am based on that determining which argument to pass to a subsequent shell command.
target:
if [ "$(tensorflowgpu)" = "false" ]; then \
conda env create -f temp-environment.yaml \
else \
conda env create -f environment.yaml \
fi
I'm wondering if there is a way to plug the respectively apt .yaml file name directly into the conda create command without using the if else fi syntax. A ternary operator which does not assign its result to a variable seems to be unavailable in shell scripts.
If that really isn't feasible at all, I'm wondering if there's some other way to make this piece of code a little more maintainable and readable, apart from refactoring the conda create command to a function and passing the yaml file to that, maybe.
Disclaimer: I'm not too proficient with shell scripting.