Add check_cmd function to verify command availability - #124
Conversation
|
Up to standards ✅🟢 Issues
|
| # Description: Checks if a specified command is available in the system. | ||
| # Usage: check_cmd "command_name" | ||
| check_cmd() { | ||
| command_name="$1" |
There was a problem hiding this comment.
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.
| command_name="$1" | |
| command_name="${1:?Missing command name argument}" |
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (1 file)
Fix these issues in Kilo Cloud Reviewed by free · Input: 0 · Output: 0 · Cached: 0 |



This pull request introduces a new utility function to the
.update.shscript for checking command availability. The main change is the addition of thecheck_cmdfunction, which provides a reusable way to verify if a command exists in the system.Utility function addition:
check_cmdfunction 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.