Skip to content

Use '[[' instead of '[' for conditional tests. The '[[' construct is safer and more feature-rich. #115

@ziagham

Description

@ziagham

Description

In the following shell conditional, the test uses both [[ and [ constructs.
To improve consistency and robustness, we should replace [ with [[ throughout the script.

Affected File: install/install.sh

lines: 32, 43, 49, 67, 89, 102, 123, 129, 142, 144, 150, 161, 166, 173, 185, 211

Example

Line 32

if [[ "$OS" == "linux" || "$OS" == "darwin" ]] && [ "$FLOWCTL_INSTALL_DIR" == "/usr/local/bin" ]; then

Suggested change

Use [[ consistently for both conditions:

if [[ ("$OS" == "linux" || "$OS" == "darwin") && "$FLOWCTL_INSTALL_DIR" == "/usr/local/bin" ]]; then

Action Items

  • Replace all instances of [ with [[ in conditional expressions.
  • Test script compatibility on supported platforms (Linux, macOS).

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or requesthelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions