This is my current code
.PHONY: setup-kind
setup-kind:
-eksctl get cluster integ-clus
([ $$? -eq "0" ] && echo "cluster exists") || echo "cluster does not exist"
This cluster does not exist so I expect "cluster does not exist" to be printed. The command(eksctl get cluster integ-clus) will fail because the cluster doesn't exist but the Makefile will keep running because i added a '-' to the start of the command(Ignore error)
The issue is that then the status of the command becomes a '0' because of my ignore addition and "cluster exists" will be printed as a result.
Does anyone have any suggestions on how I can approach this and get the code to execute the "cluster exists" block/logic?