Skip to content

Commit eb63832

Browse files
chore: make scripts work on Alpine & fix Shell Feature
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
1 parent c2923da commit eb63832

File tree

9 files changed

+254
-301
lines changed

9 files changed

+254
-301
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Development Container Features
22

33
My personal collection of [Development Container Features](https://containers.dev/implementors/features/).
4+
5+
The Features work on Alpine and other distributions.

src/hermes/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ main() {
1616
parse_dev_container_options
1717
echo "Add '[[ -f ${HOME}/.config/bash/90-hermes.sh ]] && source \"${HOME}/.config/bash/90-hermes.sh\"' to your Bash setup to enable hermes"
1818

19-
mkdir --parents /usr/local/bin/
19+
mkdir -p /usr/local/bin/
2020
mv "hermes-v11.2.3-$(uname --machine)-unknown-linux-musl" /usr/local/bin/hermes
21-
chmod +x /usr/local/bin/hermes
21+
chmod +x /usr/local/bin/hermes
2222
}
2323

2424
main "${@}"

src/lang-rust/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ rustup_adjustments() {
3131

3232
if [ "${GENERATE_SHELL_COMPLETIONS}" = 'true' ]; then
3333
log 'info' 'Generating completions for rustup and Cargo'
34-
mkdir --parents /usr/share/bash-completion/completions
34+
mkdir -p /usr/share/bash-completion/completions
3535
rustup completions bash >/usr/share/bash-completion/completions/rustup
3636
rustup completions bash cargo >/usr/share/bash-completion/completions/cargo
3737
else
@@ -55,7 +55,7 @@ copy_lldb_prettifiers() {
5555
main() {
5656
parse_dev_container_options
5757

58-
mkdir --parents "${FEATURE_SHARE_DIR}"
58+
mkdir -p "${FEATURE_SHARE_DIR}"
5959

6060
copy_lifecycle_hook_scripts
6161
rustup_adjustments

src/lang-sh/devcontainer-feature.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
"version": "0.2.3",
66
"name": "Programming Language | Bash",
77
"documentationURL": "https://github.com/georglauterbach/dev-container-features/tree/main/src/lang-sh",
8-
"description": "Work efficiently and effortlessly with Bash",
9-
"options": {
10-
"copy-libbash": {
11-
"description": "whether to copy [`libbash`](https://github.com/georglauterbach/libbash) v9.0.0 to `/usr/local/lib/`",
12-
"type": "boolean",
13-
"default": true
14-
}
8+
"description": "Work efficiently and effortlessly with shell scripts",
9+
"containerEnv": {
10+
// can be used to easily source 'libbash' by running
11+
// 'source "${DEV_CONTAINER_FEATURE_LANG_SH_SHARED_DIR}/libbash" [<LIBBASH ARGUMENTS>...]'
12+
"DEV_CONTAINER_FEATURE_LANG_SH_SHARED_DIR": "/usr/local/share/dev_containers/features/ghcr_io/georglauterbach/lang_bash"
1513
},
1614
"customizations": {
1715
"vscode": {

src/lang-sh/install.sh

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,12 @@
22

33
set -e -u
44

5-
FEATURE_SHARE_DIR=/usr/local/share/dev_containers/features/ghcr_io/georglauterbach/lang_bash
6-
readonly FEATURE_SHARE_DIR
7-
8-
parse_dev_container_options() {
9-
log 'info' 'Parsing input from options'
10-
11-
readonly COPY_LIBBASH="${COPY_LIBBASH:?COPY_LIBBASH not set or null}"
12-
}
5+
FEATURE_SHARED_DIR=/usr/local/share/dev_containers/features/ghcr_io/georglauterbach/lang_bash
6+
readonly FEATURE_SHARED_DIR
137

148
main() {
15-
parse_dev_container_options
16-
17-
cp shellcheck.conf "${FEATURE_SHARE_DIR}"
18-
cp libbash "${FEATURE_SHARE_DIR}"
19-
20-
if "${COPY_LIBBASH}"; then
21-
mkdir --parents /usr/local/lib
22-
cp libbash /usr/local/lib/
23-
fi
24-
25-
return 0
9+
cp shellcheck.conf "${FEATURE_SHARED_DIR}"
10+
cp libbash "${FEATURE_SHARED_DIR}"
2611
}
12+
13+
main

0 commit comments

Comments
 (0)