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

shell-lint: Don't fail if no shell scripts found #30

Merged
merged 1 commit into from Aug 17, 2016

Conversation

ekimekim
Copy link
Contributor

This fixes the case where the provided paths do not contain any shell scripts,
ie. xargs is passed no values.
In this case by default, xargs invokes the command once with no args.
This causes shellcheck to print usage and exit failure.
The GNU-specific --no-run-if-empty changes the behaviour so that in this case,
shellcheck is simply never run.

This allows us to use this script as a general lint even in contexts where
no shell scripts are present, or none of the files passed are shell scripts.

This fixes the case where the provided paths do not contain any shell scripts,
ie. xargs is passed no values.
In this case by default, xargs invokes the command once with no args.
This causes shellcheck to print usage and exit failure.
The GNU-specific --no-run-if-empty changes the behaviour so that in this case,
shellcheck is simply never run.

This allows us to use this script as a general lint even in contexts where
no shell scripts are present, or none of the files passed are shell scripts.
@ekimekim
Copy link
Contributor Author

related to weaveworks/scope#1776 (comment)

@jml jml merged commit f1bb537 into master Aug 17, 2016
@jml jml deleted the mike/shell-lint/dont-error-if-empty branch August 17, 2016 13:34
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.

None yet

2 participants