| #!/bin/bash | |
| # Copyright 2017 The Fuchsia Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| #### CATEGORY=Build | |
| ### list products available for building | |
| ## usage: fx list-products | |
| ## | |
| ## Lists all products that are available for building. These are names that | |
| ## can be passed to `fx set` | |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.sh || exit $? | |
| cd "${FUCHSIA_DIR}" | |
| product_gnis=($(echo {.,vendor/*}/products/*.gni | xargs -n 1 basename | sort)) | |
| for product in "${product_gnis[@]}" | |
| do | |
| # if there's no vendor/* directory, the list above will have a literal "*.gni" | |
| # filename, so filter it out | |
| if [[ ! ${product} =~ "*" ]] ; then | |
| echo "${product%%.gni}" | |
| fi | |
| done |