Skip to content

Add check_cmd function to verify command availability - #124

Merged
gvatsal60 merged 1 commit into
masterfrom
fix/command_error
Sep 27, 2026
Merged

gvatsal60 merged 1 commit into
masterfrom
fix/command_error

Conversation

@gvatsal60

Copy link
Copy Markdown
Owner

This pull request introduces a new utility function to the .update.sh script for checking command availability. The main change is the addition of the check_cmd function, which provides a reusable way to verify if a command exists in the system.

Utility function addition:

  • Added the check_cmd function to check for the presence of a specified command, returning success or failure without printing output. This function can be used for silent checks in scripts.

@gvatsal60 gvatsal60 self-assigned this Sep 27, 2026
Copilot AI lite review requested due to automatic review settings September 27, 2026 09:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sonarqubecloud

Copy link
Copy Markdown

@gvatsal60
gvatsal60 merged commit f2ec1b8 into master Sep 27, 2026
10 of 11 checks passed
@gvatsal60
gvatsal60 deleted the fix/command_error branch September 27, 2026 09:30
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Comment thread .update.sh
# Description: Checks if a specified command is available in the system.
# Usage: check_cmd "command_name"
check_cmd() {
command_name="$1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: Missing input validation - check_cmd called without arguments may incorrectly return success

If check_cmd is invoked without an argument, command_name="" and command -v "" returns 0 (success) in POSIX shells, incorrectly indicating the command exists. Add a check for empty input.

Suggested change
command_name="$1"
command_name="${1:?Missing command name argument}"

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
.update.sh 47 Missing input validation - check_cmd called without arguments may incorrectly return success
Files Reviewed (1 file)
  • .update.sh - 1 issue

Fix these issues in Kilo Cloud


Reviewed by free · Input: 0 · Output: 0 · Cached: 0

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.

2 participants