aboutsummaryrefslogtreecommitdiff
path: root/src/common-utils/bin
diff options
context:
space:
mode:
authoreitsupi <50911393+eitsupi@users.noreply.github.com>2022-12-27 16:25:33 +0300
committerGitHub <noreply@github.com>2022-12-27 16:25:33 +0300
commitb6921f9b9f594b6674b25189eee41783e6c6f22e (patch)
tree7f67ced3d778c2102788174f1f83e9191bda2ff3 /src/common-utils/bin
parentb9bfe406d211ce5645a165a73b72048e9ea9e88e (diff)
feat(common-utils): Support the new path of `meta.env` file and the new field for saving source revisions (#359)
* support the new path of meta.env * support the new field for the image revision * minor formatting
Diffstat (limited to 'src/common-utils/bin')
-rwxr-xr-xsrc/common-utils/bin/devcontainer-info10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/common-utils/bin/devcontainer-info b/src/common-utils/bin/devcontainer-info
index 2c74fea..abbb682 100755
--- a/src/common-utils/bin/devcontainer-info
+++ b/src/common-utils/bin/devcontainer-info
@@ -1,5 +1,12 @@
#!/bin/sh
-. /usr/local/etc/vscode-dev-containers/meta.env
+
+# Load meta.env
+if [ -f "/usr/local/etc/vscode-dev-containers/meta.env" ]; then
+ . /usr/local/etc/vscode-dev-containers/meta.env
+fi
+if [ -f "/usr/local/etc/dev-containers/meta.env" ]; then
+ . /usr/local/etc/dev-containers/meta.env
+fi
# Minimal output
if [ "$1" = "version" ] || [ "$1" = "image-version" ]; then
@@ -22,6 +29,7 @@ if [ ! -z "${DEFINITION_ID}" ]; then echo "- Definition ID: ${DEFINITION_ID}"; f
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 "${GIT_REPOSITORY_REVISION}" ]; then echo "- Source code revision: ${GIT_REPOSITORY_REVISION}"; fi
if [ ! -z "${BUILD_TIMESTAMP}" ]; then echo "- Timestamp: ${BUILD_TIMESTAMP}"; fi
if [ ! -z "${CONTENTS_URL}" ]; then echo && echo "More info: ${CONTENTS_URL}"; fi
echo