Skip to content

Conversation

@rm--
Copy link
Contributor

@rm-- rm-- commented Nov 11, 2023

No description provided.

## Set delimiter to newline for the loop
IFS=$'\n'
## Recursively search for git repositories
PROJECT_DIRS=$(find "$INCLUDE_LINKS" . -maxdepth "$MAXDEPTH" -mindepth 0 -name .git)
Copy link
Collaborator

@hyperupcall hyperupcall Nov 11, 2023

Choose a reason for hiding this comment

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

Thank you for the catch! A simpler fix would be to remove the quotes from $INCLUDE_LINKS. Either way LGTM

Copy link
Contributor Author

@rm-- rm-- Nov 12, 2023

Choose a reason for hiding this comment

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

I implemented this way because of the shellcheck output:

➜ shellcheck git-extras/bin/git-standup

In git-extras/bin/git-standup line 244:
        PROJECT_DIRS=$(find . -maxdepth $MAXDEPTH -mindepth 0 -name .git)
                                        ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
        PROJECT_DIRS=$(find . -maxdepth "$MAXDEPTH" -mindepth 0 -name .git)

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...

Copy link
Collaborator

@hyperupcall hyperupcall Nov 12, 2023

Choose a reason for hiding this comment

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

I see - yeah that would be a false positive. Unfortunately some ShellCheck rules seem to have a lot of false positives.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can change it to your suggestion. It's your decision.
But until now shellcheck like the file. ;)

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use something like #shellcheck disable=SC2086 to disable the spurious warning

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks!

@rm-- rm-- force-pushed the find-error-in-git-standup branch from dce1ffb to 7e67dd3 Compare November 12, 2023 12:40
## Set delimiter to newline for the loop
IFS=$'\n'
## Recursively search for git repositories
PROJECT_DIRS=$(find "$INCLUDE_LINKS" . -maxdepth "$MAXDEPTH" -mindepth 0 -name .git)
Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks!

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.

3 participants