summaryrefslogtreecommitdiff
path: root/home/xyz/.local/bin/mmi
blob: b3b5868fe2da3ad7697f2840fb4a7295e013ab6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

mi ()
{
	sudo make -B install
}

origin="$PWD"
cmd='mi'

while getopts q opt; do
	case $opt in
		q) cmd='qmake6;mi';;
		\?) exit 1;;
	esac
done
shift $((OPTIND-1))

if [ -z "$1" ]; then
	eval "$cmd"
else
	for dir ; do
		cd "$dir" || exit
		eval "$cmd"
		cd "$origin" || exit
	done
fi