summaryrefslogtreecommitdiff
path: root/.local/bin/aliasgen
blob: 8f976d07fc634f43b38391c8dbd22457abb168bf (plain)
1
2
3
4
5
6
7
#!/bin/sh

# Removing unecessary comments and documentation
raw="$(sed 's/^\s*//;s/#.*$//;s/,\s*/,/g;/^$/d' <"${XDG_CONFIG_HOME:-$HOME/.config}/aliasrc")"

# #---zsh---# #
echo "$raw" | sed 's/\(.*\),\(.*\)/\1(){\2 $@}/' >"${XDG_CACHE_HOME:-$HOME/.cache}/zsh-aliases"