This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathinstall.sh
executable file
·65 lines (49 loc) · 1.75 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
set -e
# The install.sh script is the installation entrypoint for any dev container 'features' in this repository.
#
# The tooling will parse the devcontainer-features.json + user devcontainer, and write
# any build-time arguments into a feature-set scoped "devcontainer-features.env"
# The author is free to source that file and use it however they would like.
set -a
. ./devcontainer-features.env
set +a
if [ ! -z ${_BUILD_ARG_HELLOWORLD} ]; then
echo "Activating feature 'helloworld'"
# Build args are exposed to this entire feature set following the pattern: _BUILD_ARG_<FEATURE ID>_<OPTION NAME>
GREETING=${_BUILD_ARG_HELLOWORLD_GREETING:-undefined}
tee /usr/hello.sh > /dev/null \
<< EOF
#!/bin/bash
RED='\033[0;91m'
NC='\033[0m' # No Color
echo -e "\${RED}${GREETING}, \$(whoami)!"
echo -e "\${NC}"
EOF
chmod +x /usr/hello.sh
sudo cat '/usr/hello.sh' > /usr/local/bin/hello
sudo chmod +x /usr/local/bin/hello
fi
if [ ! -z ${_BUILD_ARG_COLOR} ]; then
echo "Activating feature 'color'"
# Build args are exposed to this entire feature set following the pattern: _BUILD_ARG_<FEATURE ID>_<OPTION NAME>
if [ "${_BUILD_ARG_COLOR_FAVORITE}" == "red" ]; then
FAVORITE='\\033[0\;91m'
fi
if [ "${_BUILD_ARG_COLOR_FAVORITE}" == "green" ]; then
FAVORITE='\\033[0\;32m'
fi
if [ "${_BUILD_ARG_COLOR_FAVORITE}" == "gold" ]; then
FAVORITE='\\033[0\;33m'
fi
tee /usr/color.sh > /dev/null \
<< EOF
#!/bin/bash
NC='\033[0m' # No Color
FAVORITE=${FAVORITE}
echo -e "\${FAVORITE} This is my favorite color! \${NC}"
EOF
chmod +x /usr/color.sh
sudo cat '/usr/color.sh' > /usr/local/bin/color
sudo chmod +x /usr/local/bin/color
fi