-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeldq
executable file
·70 lines (62 loc) · 1.61 KB
/
meldq
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
# This is a quiet meld launcher.
COMMAND="meld"
# COMMAND="diffuse"
if [ ! -f "`command -v nohup`" ]; then
echo "$0 requires nohup"
exit 1
fi
if [ ! -f "`command -v $COMMAND`" ]; then
echo "$0 requires $COMMAND"
exit 1
fi
if [ -z "$1" ]; then
echo "You must specify 2 or 3 files or directories."
exit 1
elif [ ! -f "$1" ]; then
if [ ! -d "$1" ]; then
echo "'$1' is neither a file nor a directory"
exit 1
fi
fi
if [ -z "$2" ]; then
echo "You must specify 2 or 3 files or directories."
exit 1
elif [ ! -f "$2" ]; then
if [ ! -d "$2" ]; then
echo "'$2' is neither a file nor a directory"
exit 1
fi
fi
if [ -f "$1" ]; then
if [ ! -f "$2" ]; then
echo "Cannot compare a file ('$1') to something that is not a file ('$2')"
exit 1
fi
elif [ -d "$1" ]; then
if [ ! -d "$2" ]; then
echo "Cannot compare a directory ('$1') to something that is not a directory ('$2')"
exit 1
fi
fi
if [ ! -z "$3" ]; then
if [ -f "$1" ]; then
if [ ! -f "$3" ]; then
echo "Cannot compare a file ('$1') to something that is not a file ('$3')"
exit 1
fi
elif [ -d "$1" ]; then
if [ ! -d "$3" ]; then
echo "Cannot compare a directory ('$1') to something that is not a directory ('$3')"
exit 1
fi
fi
nohup $COMMAND "$1" "$2" "$3" >& /dev/null & disown
else
nohup $COMMAND "$1" "$2" >& /dev/null & disown
fi
#Doesn't work, so check for files first:
#if [ $? -ne 0 ]; then
# echo "ERROR, showing..."
# nohup meld "$1" "$2" "$3"
#fi