Added check for if git exists #5444

Merged
merged 2 commits into from Jan 15, 2017

Projects

None yet

6 participants

@geordish
Contributor

Should hopefully not stop validate running if git is missing.

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

@geordish geordish Added check for if git exists
65fc571
@mention-bot

Thank you for submitting a PR @geordish! We have found the following @murrant, @laf and @paulgear based on the history of these files to review this PR.

@geordish geordish Change == to ===
a63375b
@scrutinizer-notifier

The inspection completed: 1 updated code elements

@@ -75,6 +75,11 @@
exit;
}
+$git_found = check_git_exists();
+if ($git_found !== true) {
@Gorian
Gorian Jan 15, 2017 Contributor

could you use if (!$git_found){ instead?

-if ($config['update_channel'] == 'master' && $cur_sha != $versions['github']['sha']) {
- $commit_date = new DateTime('@'.$versions['local_date'], new DateTimeZone(date_default_timezone_get()));
- print_warn("Your install is out of date, last update: " . $commit_date->format('r'));
+if ($git_found === true) {
@Gorian
Gorian Jan 15, 2017 Contributor

could you use if ($git_found){ here?

@laf
laf Jan 15, 2017 Member

=== is better, it's more explicit

@Gorian
Gorian Jan 15, 2017 Contributor

Alright, as long as we are doing it purposefully, you are the master of the php code ;)

@Gorian
Contributor
Gorian commented Jan 15, 2017

I think that @mention-bot thing is really cool. Look at who last contributed to a file and then mention them to review new changes.

@laf laf merged commit 44071e8 into librenms:master Jan 15, 2017

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment