Convert themes to TOML

This commit is contained in:
Deepankar Chakroborty 2024-03-14 14:04:09 -07:00
parent a08af95bd4
commit 7f833712b2

View file

@ -16,16 +16,21 @@
# shopt -s globstar
cd themes
if command -v yj > /dev/null 2>&1; then
# For each .yaml file in the current directory
for yaml_file in *.yml; do
# Use basename to get the file name without the .yaml extension
base_name=$(basename "$yaml_file" .yml)
if command -v sd > /dev/null 2>&1; then
if command -v yj > /dev/null 2>&1; then
# For each .yaml file in the current directory
for yaml_file in *.yml; do
# Use basename to get the file name without the .yaml extension
base_name=$(basename "$yaml_file" .yml)
# Convert .yaml to .toml using yj
cat "$yaml_file" | yj -yt > "${base_name}.toml"
done
# Convert .yaml to .toml using yj
cat "$yaml_file" | yj -yt | sd "^.*_background.*\r?\n" "" | sd "^.*_foreground.*\r?\n" "" > "${base_name}.toml"
done
else
echo "Get yj from: https://github.com/sclevine/yj"
fi
else
echo "Get yj from: https://github.com/sclevine/yj"
echo "Get sd from: https://github.com/chmln/sd"
fi