Skip to content
This repository was archived by the owner on Jul 12, 2025. It is now read-only.

Commit a61714c

Browse files
committed
Add devcontainer-feature config
1 parent c8f04fe commit a61714c

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

devcontainer-features.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"features": [
3+
{
4+
"id": "asdf",
5+
"name": "asdf Feature",
6+
"options": {
7+
"version": {
8+
"type": "string",
9+
"proposals": [ "v0.10.2" ],
10+
"default": "v0.10.2",
11+
"description": "Select asdf version"
12+
}
13+
},
14+
"include": ["ubuntu"]
15+
}
16+
]
17+
}

install.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# The install.sh script is the installation entrypoint for any dev container 'features' in this repository.
5+
#
6+
# The tooling will parse the devcontainer-features.json + user devcontainer, and write
7+
# any build-time arguments into a feature-set scoped "devcontainer-features.env"
8+
# The author is free to source that file and use it however they would like.
9+
set -a
10+
. ./devcontainer-features.env
11+
set +a
12+
13+
if [ ! -z ${_BUILD_ARG_ASDF} ]; then
14+
echo "Activating feature 'asdf'"
15+
16+
# Build args are exposed to this entire feature set following the pattern: _BUILD_ARG_<FEATURE ID>_<OPTION NAME>
17+
VERSION=${_BUILD_ARG_ASDF_VERSION}
18+
19+
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch $VERSION
20+
21+
echo ". $HOME/.asdf/asdf.sh" >> ~/.bashrc
22+
fi

0 commit comments

Comments
 (0)