summaryrefslogtreecommitdiff
path: root/.local/bin/mmi
blob: 6945008443c1c69133f2efe9ddd75396025fc290 (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
28
#!/bin/sh

mm ()
{
	make -B
	sudo make install
}

origin="$PWD"
cmd='mm'

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

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