Skip to content

Commit

Permalink
🐛 Fix shell: select asset if just one. (#3416)
Browse files Browse the repository at this point in the history
Signed-off-by: Preslav <[email protected]>
  • Loading branch information
preslavgerchev authored Feb 23, 2024
1 parent 62e78c9 commit dd2d7b1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/cnquery/cmd/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ func StartShell(runtime *providers.Runtime, conf *ShellConfig) error {
}

var connectAsset *scan.AssetWithRuntime
if len(filteredAssets) > 1 {
if len(filteredAssets) == 1 {
connectAsset = filteredAssets[0]
} else if len(filteredAssets) > 1 {
invAssets := make([]*inventory.Asset, 0, len(filteredAssets))
for _, a := range filteredAssets {
invAssets = append(invAssets, a.Asset)
Expand Down

0 comments on commit dd2d7b1

Please sign in to comment.