VisionSystemsInc / VisionSystemsInc/vsi_common

Style refactor: checking if an array is set/unset

Open
#387 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

style
Dominant language
Shell
Stars
8
Forks
9
Avg merge
36m
Merged PRs (30d)
1

Description

We currently use [ " ""${array[@]+set}" = " set" ] to check if an array is set

[ -n "${array[*]+set}" ] is simpler and more in line with how we check normal variables, we should switch to that

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the repository for the existing array-set check [ " ""${array[@]+set}" = " set" ] and review each occurrence in the common scripts. Replace the checks with the proposed ${array[*]+set} form, then verify that array set and unset cases retain their current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
tooling
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.