From 296718ce286ed551d8b20632294a8bb7de516ea3 Mon Sep 17 00:00:00 2001 From: James Conroy Date: Mon, 6 Sep 2021 13:10:41 -0400 Subject: [PATCH] refactor: install.sh to improve usage and install instructions (#3025) * Refactored the usage function to use printf Using printf to print the usage function instead of a here doc handles the formatting for us so it will be consistent across a wide variety of terminal emulators. Here docs also tend to mess up auto-formatters so removing it has that added benefit. * Made the install instructions their own function The function loops through simular install instructions so this way we won't have to repeat ourselves every time we add a new supported shell. * Set default config_file location The default location is based on the name of the shell. It is overwritten when needed. Co-authored-by: Thomas O'Donnell Co-authored-by: Thomas O'Donnell --- install/install.sh | 154 +++++++++++++++++++++++++++------------------ 1 file changed, 94 insertions(+), 60 deletions(-) diff --git a/install/install.sh b/install/install.sh index 06d97d59..a1b06c2d 100755 --- a/install/install.sh +++ b/install/install.sh @@ -115,36 +115,21 @@ unpack() { } usage() { - cat <