-
Notifications
You must be signed in to change notification settings - Fork 61
fix: Call sub-scripts with bash instead of sh #714
Conversation
|
||
if [[ -z "${REPO_NAME}" || -z "${REPO_NAME}" ]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep the non-posix compliant double brackets, but yes this line should be changed to remove the second part of this OR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
So made some edits to my top-level comment up there, but basically the issues in #713 were happening because we were calling the subscripts explicitly with sh which meant the shebang at the top telling them to run with bash didn't matter, and therefore we didn't get to use the fancy bash functionality like This PR is ready to go now |
@@ -295,7 +295,7 @@ if [[ -z "$SKIP_AUTH" ]]; then | |||
read -rp "Would you like to configure $(tput bold)$(tput setaf 3)end-user authentication?$(tput sgr0) (y/n) " auth_yesno | |||
|
|||
if [[ ${auth_yesno} == "y" ]]; then | |||
sh ./scripts/configure_auth.sh | |||
./scripts/configure_auth.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the right way to run it or should we use bash
explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should work just fine 👍
@@ -295,7 +295,7 @@ if [[ -z "$SKIP_AUTH" ]]; then | |||
read -rp "Would you like to configure $(tput bold)$(tput setaf 3)end-user authentication?$(tput sgr0) (y/n) " auth_yesno | |||
|
|||
if [[ ${auth_yesno} == "y" ]]; then | |||
sh ./scripts/configure_auth.sh | |||
./scripts/configure_auth.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should work just fine 👍
This fixes many of the key issues in #713
Which it turned out had less to do with POSIX compliance as it did with us explicitly calling sub-scripts configure-delivery and configure-auth using sh. Removing this call lets the shebang at the top of the files do their work so they end up being run with the environment bash.
On some machines, sh is bash so this wasn't an issue, but on many machines sh is a POSIX compliant dash variant.
This PR changes those calls to not run with sh, and also removes a weird conditional discovered in the process.