summaryrefslogtreecommitdiff
path: root/.local/bin/aliasgen
blob: 9489fbc64dc96d22a9bcdf9fb01f152036cbed12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# Removing unecessary comments and documentation
raw=$(cat $HOME/.config/aliasrc | tail -n +17 "$HOME/.config/aliasrc" | sed "s/^|\s*//g;
		s/\(.*\)|\(.*\)|\(.*\)|/\1|\2|\3/g;
		s/\s*$//g;
		/^$/d")

# #---zsh---# #
echo "$raw" | sed "s/^/alias\ /;
                s/\s*|\s*/=\"/;
                s/^.*-*+-*=\"$//;
                s/\s*|$/\"/" > $HOME/.cache/zsh-aliases
case "$SHELL" in
	*zsh) $HOME/.cache/zsh-aliases ;;
	*) ;;
esac