Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: git-standup find error (#1106) #1110

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

rm--
Copy link
Contributor

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

No description provided.

@@ -240,7 +240,11 @@ if [[ $in_git_repo != 0 ]]; then
## 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
@@ -240,7 +240,11 @@ if [[ $in_git_repo != 0 ]]; then
## 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!

@spacewander spacewander merged commit 58c5b50 into tj:main Nov 14, 2023
5 checks passed
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