mirror of
https://github.com/catppuccin/catppuccin
synced 2024-11-10 14:14:22 +00:00
feat: specify custome prefix (-p <>) with the color updater script
This commit is contained in:
parent
f4821dcef2
commit
04e7138be2
1 changed files with 10 additions and 4 deletions
|
@ -3,6 +3,7 @@
|
|||
# ---------- sys ---------
|
||||
lowercase=false
|
||||
file=""
|
||||
prefix=""
|
||||
|
||||
this_script=$(basename "$0")
|
||||
script_help=$( cat << EOF
|
||||
|
@ -12,9 +13,10 @@ Usages:
|
|||
#0: ${this_script} <flag> [arg]
|
||||
|
||||
Flags:
|
||||
-f, --file specify file (mandatory)
|
||||
-l, --lowercase replaces with lowercased hex code
|
||||
-h, --help see this message
|
||||
-f, --file specify file (mandatory)
|
||||
-l, --lowercase replaces with lowercased hex codes
|
||||
-p, --prefix specify which prefix to use for the hex codes. Surround it with double quotes if needed.
|
||||
-h, --help see this message
|
||||
EOF
|
||||
)
|
||||
|
||||
|
@ -39,7 +41,7 @@ function update_colors() {
|
|||
}
|
||||
for clr in "${!colors[@]}"; do
|
||||
echo -e " + ${clr} -> ${colors[$clr]}"
|
||||
sed -i "s/${clr}/${capitalization_char}${colors[$clr]}/gI" "$file"
|
||||
sed -i "s/${clr}/${prefix}${capitalization_char}${colors[$clr]}/gI" "$file"
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -56,6 +58,10 @@ main() {
|
|||
-l | --lowercase)
|
||||
lowercase=true
|
||||
;;
|
||||
-p | --prefix)
|
||||
prefix=$2
|
||||
shift
|
||||
;;
|
||||
-h | --help)
|
||||
echo "$script_help"
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue