File tree Expand file tree Collapse file tree 6 files changed +116
-0
lines changed Expand file tree Collapse file tree 6 files changed +116
-0
lines changed Original file line number Diff line number Diff line change 16
16
- atuin.sh
17
17
- btop
18
18
- deno.com
19
+ - pkgx.sh
19
20
- smallstep.com
20
21
- starship.rs
21
22
baseImage :
40
41
- atuin.sh
41
42
- btop
42
43
- deno.com
44
+ - pkgx.sh
43
45
- smallstep.com
44
46
- starship.rs
45
47
steps :
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " pkgx.sh" ,
3
+ "id" : " pkgx.sh" ,
4
+ "version" : " 1.0.0" ,
5
+ "description" : " Install \" pkgx\" binary" ,
6
+ "documentationURL" : " https://github.com/devcontainer-community/devcontainer-features/tree/main/src/pkgx.sh" ,
7
+ "options" : {
8
+ "version" : {
9
+ "type" : " string" ,
10
+ "default" : " latest" ,
11
+ "proposals" : [
12
+ " latest"
13
+ ],
14
+ "description" : " Version of \" pkgx\" to install."
15
+ }
16
+ }
17
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -o errexit
3
+ set -o pipefail
4
+ set -o noclobber
5
+ set -o nounset
6
+ set -o allexport
7
+ readonly name=" pkgx"
8
+ apt_get_cleanup () {
9
+ apt-get clean
10
+ rm -rf /var/lib/apt/lists/*
11
+ }
12
+ apt_get_update () {
13
+ if [ " $( find /var/lib/apt/lists/* | wc -l) " = " 0" ]; then
14
+ echo " Running apt-get update..."
15
+ apt-get update -y
16
+ fi
17
+ }
18
+ apt_get_checkinstall () {
19
+ if ! dpkg -s " $@ " > /dev/null 2>&1 ; then
20
+ apt_get_update
21
+ DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends --no-install-suggests --option ' Debug::pkgProblemResolver=true' --option ' Debug::pkgAcquire::Worker=1' " $@ "
22
+ fi
23
+ }
24
+ check_curl_installed () {
25
+ declare -a requiredAptPackagesMissing=()
26
+ if ! [ -r ' /etc/ssl/certs/ca-certificates.crt' ]; then
27
+ requiredAptPackagesMissing+=(' ca-certificates' )
28
+ fi
29
+ if ! command -v curl > /dev/null 2>&1 ; then
30
+ requiredAptPackagesMissing+=(' curl' )
31
+ fi
32
+ declare -i requiredAptPackagesMissingCount=${# requiredAptPackagesMissing[@]}
33
+ if [ $requiredAptPackagesMissingCount -gt 0 ]; then
34
+ apt_get_checkinstall " ${requiredAptPackagesMissing[@]} "
35
+ apt_get_cleanup
36
+ fi
37
+ }
38
+ echo_banner () {
39
+ local text=" $1 "
40
+ echo -e " \e[1m\e[97m\e[41m$text \e[0m"
41
+ }
42
+ install () {
43
+ check_curl_installed
44
+ apt_get_update
45
+ export DENO_INSTALL=" /usr/local"
46
+ curl -fsSL https://pkgx.sh | sh
47
+ apt_get_cleanup
48
+ }
49
+ echo_banner " devcontainer.community"
50
+ echo " Installing $name ..."
51
+ install " $@ "
52
+ echo " (*) Done!"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+
4
+ set -e
5
+
6
+ # Optional: Import test library bundled with the devcontainer CLI
7
+ # See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib
8
+ # Provides the 'check' and 'reportResults' commands.
9
+ source dev-container-features-test-lib
10
+
11
+ # Feature-specific tests
12
+ # The 'check' command comes from the dev-container-features-test-lib. Syntax is...
13
+ # check <LABEL> <cmd> [args...]
14
+ check " execute command" bash -c " pkgx --version | grep 'pkgx'"
15
+
16
+ # Report results
17
+ # If any of the checks above exited with a non-zero exit code, the test will fail.
18
+ reportResults
Original file line number Diff line number Diff line change
1
+ {
2
+ "pkgx.sh-debian" : {
3
+ "image" : " mcr.microsoft.com/devcontainers/base:debian" ,
4
+ "features" : {
5
+ "pkgx.sh" : {
6
+ }
7
+ }
8
+ }
9
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+
4
+ set -e
5
+
6
+ # Optional: Import test library bundled with the devcontainer CLI
7
+ # See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib
8
+ # Provides the 'check' and 'reportResults' commands.
9
+ source dev-container-features-test-lib
10
+
11
+ # Feature-specific tests
12
+ # The 'check' command comes from the dev-container-features-test-lib. Syntax is...
13
+ # check <LABEL> <cmd> [args...]
14
+ check " execute command" bash -c " pkgx --version | grep 'pkgx'"
15
+
16
+ # Report results
17
+ # If any of the checks above exited with a non-zero exit code, the test will fail.
18
+ reportResults
You can’t perform that action at this time.
0 commit comments