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

Add shellcheck #60

Merged
merged 2 commits into from
May 29, 2023
Merged

Add shellcheck #60

merged 2 commits into from
May 29, 2023

Conversation

jcbhmr
Copy link
Collaborator

@jcbhmr jcbhmr commented May 29, 2023

This PR would...

This would make sure that we do everything the "right way"! 😊

@jcbhmr jcbhmr self-assigned this May 29, 2023
@jcbhmr
Copy link
Collaborator Author

jcbhmr commented May 29, 2023

./src/clone.sh:47:8: warning: Declare and assign separately to avoid masking return values. [SC2155]
./src/init.sh:47:8: warning: Declare and assign separately to avoid masking return values. [SC2155]
export GIT_DIR=$(mktemp -d)
# vs we want this:
export GIT_DIR && GIT_DIR=$(mktemp -d)

that way if mktemp fails, it bubbles instead of 'export' command returning zero and "this is fine, continue" even though the mktemp failed

@jcbhmr jcbhmr marked this pull request as ready for review May 29, 2023 21:08
@jcbhmr
Copy link
Collaborator Author

jcbhmr commented May 29, 2023

Merging this as I think this is a pretty safe "add checks to make better code" change.

@jcbhmr jcbhmr merged commit 2d8733d into master May 29, 2023
@jcbhmr jcbhmr deleted the jcbhmr-patch-1 branch June 9, 2023 21:20
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.

1 participant