Giving either --install or --update flag is neccessary for the script to proceed
-i | --install => Install the config.
-u | --update => Update the existing config without removing existing stuff.
-b | --backup 'path' => Custom config backup path.
-nb | --no-backup => Don't take existing config backup. Use with caution.
Update formatting using following command
shfmt -i 2 -sr -p -bn -ci -w install.sh
* modify sed command to work in both gnu sed and mac os sed
https://stackoverflow.com/a/4247319
* use printf everywhere for more compatibility
* add some error checking
Gave up and decided to clone the config and reinstall over my previous install to add later. Made the following modifications:
1 - removed the extra echos (use echo -e "\n some line " in the future)
2 - packer doesn't install if there's a previously installed packer folder. So the bash script purges the previous packer folder and starts anew.
tested the config correctly