forked from fastly/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.sh
executable file
·43 lines (34 loc) · 959 Bytes
/
config.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
#!/usr/bin/env bash
set -e
cp ".fastly/config.toml" "pkg/config/config.toml"
if ! command -v tomlq &> /dev/null
then
cargo install tomlq
fi
kits=(
compute-starter-kit-assemblyscript-default
compute-starter-kit-go-default
compute-starter-kit-go-tinygo
compute-starter-kit-javascript-default
compute-starter-kit-javascript-empty
compute-starter-kit-rust-default
compute-starter-kit-rust-empty
compute-starter-kit-rust-static-content
compute-starter-kit-rust-websockets
compute-starter-kit-typescript
)
function parse() {
tomlq -f "$k.toml" $1
}
function append() {
echo $1 >> pkg/config/config.toml
}
for k in ${kits[@]}; do
curl -s "https://raw.githubusercontent.com/fastly/$k/main/fastly.toml" -o "$k.toml"
append ''
append "[[starter-kits.$(parse language)]]"
append "description = \"$(parse description)\""
append "name = \"$(parse name)\""
append "path = \"https://github.com/fastly/$k\""
rm "$k.toml"
done