chore(cli): enhance version handling and testing mechanisms

- Add a command to print the version of the target before running the main command

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2024-07-14 16:21:41 +08:00
parent 036cad7df7
commit 8b6078208d
No known key found for this signature in database

View file

@ -63,4 +63,5 @@ TARGET="${GITHUB_ACTION_PATH}/${CLIENT_BINARY}"
echo "Will download ${CLIENT_BINARY} from ${DOWNLOAD_URL_PREFIX}" echo "Will download ${CLIENT_BINARY} from ${DOWNLOAD_URL_PREFIX}"
curl -fL --retry 3 --keepalive-time 2 "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o ${TARGET} curl -fL --retry 3 --keepalive-time 2 "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o ${TARGET}
chmod +x ${TARGET} chmod +x ${TARGET}
sh -c "${TARGET} $*" sh -c "${TARGET} --version" # print version
sh -c "${TARGET} $*" # run the command