Created
December 11, 2023 13:03
-
-
Save tribut/1563beef44dbae01c77bf0b34a151f96 to your computer and use it in GitHub Desktop.
Combine multiple toml files for starship
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eEuo pipefail | |
CONF_FILE="$HOME/.config/starship.toml" | |
CONF_D="$HOME/.config/starship.d" | |
TEMPFILE="$(mktemp)" | |
starship preset -o "$CONF_D/99-nerd-font-symbols.toml" nerd-font-symbols | |
# toml-merge always requires an "original toml" and applies patch-files (-p) | |
docker run --rm --network=none --user "$(id -u):$(id -g)" -v "$CONF_D:/conf:ro" -w /conf ghcr.io/mesosphere/toml-merge:v0.2.0 -p '*.toml' '10-global.toml' > "$TEMPFILE" | |
sed -i '1 i # Auto-generated by update-starship-config, do not edit' "$TEMPFILE" | |
mv "$TEMPFILE" "$CONF_FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment