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

tasks/postgres_upgrade.sh: shellcheck and related fixes #357

Merged
merged 2 commits into from
Sep 15, 2020

Conversation

kenyon
Copy link
Member

@kenyon kenyon commented Sep 15, 2020

Some bash and command usage improvements. Fixes #356.

1. Use better and safer [[-style test, which doesn't need variables to
be quoted.

2. Use an arithmetic expression instead of old-style test command.
The -h means human readable, but that output format is overridden by
the -k, which means output a number of 1024-byte blocks.
@kenyon kenyon changed the title tasks/postgres_upgrade.sh shellcheck and related fixes tasks/postgres_upgrade.sh: shellcheck and related fixes Sep 15, 2020
Copy link

@igalic igalic left a comment

Choose a reason for hiding this comment

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

i just noticed that the code already is bash-only, thanks to the shebang line

but if you revert (half) these changes, you could make it POSIX sh (maybe ;)

tasks/postgres_upgrade.sh Show resolved Hide resolved
tasks/postgres_upgrade.sh Show resolved Hide resolved
@kenyon
Copy link
Member Author

kenyon commented Sep 15, 2020

Yes, that's what I want. :) Since it was already #!/bin/bash, might as well use the nice features of bash that make it a much safer programming language than plain sh.

Copy link

@igalic igalic left a comment

Choose a reason for hiding this comment

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

🤷🏻‍♀️

@kenyon kenyon merged commit bbf5ff4 into voxpupuli:master Sep 15, 2020
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.

shellcheck validation of tasks/postgres_upgrade.sh fails
2 participants