我目前正在编写通过 CLI 在本地安装流集扩展的代码。我要编写的一项检查是确保扩展适用于本地安装的流集版本。
当我尝试从 CLI 查询版本时,这就是我遇到的问题。
:) streamsets --version
Invalid sub-command
streamsets <SUB_COMMAND> [<SUB_COMMAND_ARGUMENTS>]
Sub-commands:
dc: Starts the Data Collector
create-dc: Creates new instance of Data Collector
cli: Data Collector CLI
jks-cs: Java Keystore Credential Store
stagelibs: Data Collector Stage library installer
show-vault-id: Shows the user-id to authorize in Vault
setup-mapr: Enables the MapR stage library for the detected
MapR installation.
:( streamsets cli --version
Found unexpected parameters: [--version]
) streamsets dc --version
Invalid option(s)
streamsets dc <OPTIONS>
Options:
-verbose : prints out Data Collector detailed environment settings
-exec : starts Data Collector JVM within the same process of the script
-skipenvsourcing : skips the sourcing of the libexec/sdc-env.sh file
除了遍历文件系统并查找文件之外,我如何确定安装了哪个版本的流集VERSION
?