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

Bugfix for check command exists #70

Merged
merged 1 commit into from
Jan 11, 2022
Merged

Bugfix for check command exists #70

merged 1 commit into from
Jan 11, 2022

Conversation

jaydouble
Copy link
Contributor

in the current version, the check_docker_command is always returning false. So docker restart containers and or services is never going to work.

I've make little fix, and also introduce a new function to check any command exists.

This is also my very first pull request every on github (as far as I remember). So please, don't be angry if I don't do something right.

@kereis
Copy link
Owner

kereis commented Jan 6, 2022

Hi,

don't worry. :D Thank you for your contribution!

Regarding the bugfix: I haven't tested your changes yet, but doesn't echo print the text and in this case the return value? I have also seen multiple examples, where echo as a sort of return statement, but to be honest, I was a bit afraid testing it because I don't know if it prints the return value into the shell or not. :D

@kereis kereis self-assigned this Jan 6, 2022
@kereis kereis added type: bug Something isn't working. type: fix Iterations on existing features or infrastructure. labels Jan 6, 2022
@jaydouble
Copy link
Contributor Author

The function wil echo it out, but the $() will grab the output, an put that into the variable.
example

currentTimestamp=$(date +%s)

if you type date +%s in your terminal, you will see someting like 1641850387.
So bash (or any other linux shell) will grab the output of the command, and put it into the variable, so the variable currentTimestamp will now contain 1641850387

@kereis
Copy link
Owner

kereis commented Jan 11, 2022

I guess it's "the way" to go in Bash. I was sort of thinking Java-ish. :D

Copy link
Owner

@kereis kereis left a comment

Choose a reason for hiding this comment

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

LGTM!

@kereis kereis merged commit 6b95374 into kereis:develop Jan 11, 2022
@jaydouble jaydouble deleted the bugfix/command-docker branch January 13, 2022 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working. type: fix Iterations on existing features or infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants