Skip to content

Conversation

yorinasub17
Copy link
Contributor

This ports functions that are in terraform-aws-zookeeper/modules/bash-commons:

  • assert_user_has_sudo_perms
  • string_substr

@yorinasub17 yorinasub17 requested a review from brikis98 as a code owner June 11, 2021 17:06
brikis98
brikis98 previously approved these changes Jun 11, 2021
fi

if [[ -z "$end" ]]; then
end=${#str}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: should ${#str} be wrapped in quotes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do it for consistency, but it's not necessary in this case (shellcheck doesn't flag it). Normally, the "" is done to avoid wordsplitting, but in this case the result is always a number so there is no risk of word splitting.

Updated in: cc05e08

Copy link
Member

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yorinasub17
Copy link
Contributor Author

Thanks for review! Build passed, so will go ahead to merge this in!

@yorinasub17 yorinasub17 merged commit 4034968 into master Jun 11, 2021
@yorinasub17 yorinasub17 deleted the yori-strings-substr branch June 11, 2021 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants