diff options
author | Chuck Lantz <clantz@microsoft.com> | 2022-12-16 20:47:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-16 20:47:21 +0300 |
commit | bf058dc49492b3a102a28ed25764a517fcebfb40 (patch) | |
tree | 6ccc831064fab57ea6fa2f0c530202ac0d73ff08 /src/common-utils/bin/devcontainer-info | |
parent | 7fa90110d762797cc0b1c2fe8fcc028c9b813d56 (diff) |
Multi-distro support for common script, refactor, fixes (#326)
Diffstat (limited to 'src/common-utils/bin/devcontainer-info')
-rwxr-xr-x | src/common-utils/bin/devcontainer-info | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/common-utils/bin/devcontainer-info b/src/common-utils/bin/devcontainer-info new file mode 100755 index 0000000..2c74fea --- /dev/null +++ b/src/common-utils/bin/devcontainer-info @@ -0,0 +1,27 @@ +#!/bin/sh +. /usr/local/etc/vscode-dev-containers/meta.env + +# Minimal output +if [ "$1" = "version" ] || [ "$1" = "image-version" ]; then + echo "${VERSION}" + exit 0 +elif [ "$1" = "release" ]; then + echo "${GIT_REPOSITORY_RELEASE}" + exit 0 +elif [ "$1" = "content" ] || [ "$1" = "content-url" ] || [ "$1" = "contents" ] || [ "$1" = "contents-url" ]; then + echo "${CONTENTS_URL}" + exit 0 +fi + +#Full output +echo +echo "Development container image information" +echo +if [ ! -z "${VERSION}" ]; then echo "- Image version: ${VERSION}"; fi +if [ ! -z "${DEFINITION_ID}" ]; then echo "- Definition ID: ${DEFINITION_ID}"; fi +if [ ! -z "${VARIANT}" ]; then echo "- Variant: ${VARIANT}"; fi +if [ ! -z "${GIT_REPOSITORY}" ]; then echo "- Source code repository: ${GIT_REPOSITORY}"; fi +if [ ! -z "${GIT_REPOSITORY_RELEASE}" ]; then echo "- Source code release/branch: ${GIT_REPOSITORY_RELEASE}"; fi +if [ ! -z "${BUILD_TIMESTAMP}" ]; then echo "- Timestamp: ${BUILD_TIMESTAMP}"; fi +if [ ! -z "${CONTENTS_URL}" ]; then echo && echo "More info: ${CONTENTS_URL}"; fi +echo |