-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
31 lines (25 loc) · 959 Bytes
/
justfile
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
_default:
@just --list
clean:
rm -rf languages/
update: clean
#!/usr/bin/env bash
LANGUAGES=("html" "css" "json" "yaml" "toml" "")
for LANGUAGE in "${LANGUAGES[@]}"; do
UP_LANG=$(echo "$LANGUAGE" | tr '[:lower:]' '[:upper:]');
if [[ -z "$LANGUAGE" ]]; then
TARGET_DIR="languages/tera"
else
TARGET_DIR="languages/tera-$LANGUAGE"
fi
mkdir -p "$TARGET_DIR"
cp ./template/brackets.scm "$TARGET_DIR/"
cp ./template/highlights.scm "$TARGET_DIR/"
cp ./template/injections.scm "$TARGET_DIR/"
if [[ -n "$LANGUAGE" ]]; then
sed "s/<lang>/$LANGUAGE/g" ./template/injections/content-manual.scm >> "$TARGET_DIR/injections.scm"
cat ./template/config.toml | sed "s/name = \"Tera\"/name = \"Tera ($UP_LANG)\"/" ./template/config.toml > "$TARGET_DIR/config.toml"
else
sed 's/path_suffixes = \[\]/path_suffixes = \["tera"\]/' ./template/config.toml > "$TARGET_DIR/config.toml"
fi
done