I want to automate some setup tasks. When a team member writes setup
which is our internal command, a couple of things would be done.
One of those things is to make sure the latest version of our infra
repository is either pulled or cloned onto his laptop.
But if he does not have the infra
repository cloned, I want to clone it based on his permission.
In other words here's what I want:
# This command would run if he has write access
git clone git@github.com:company/infra
If the above command failed, I want to run this command
git clone https://github.com/company/infra
How can I run the second line, only if the first line failed?
$?
). – dirkt Dec 27 '21 at 08:41