File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,13 @@ if [ -z "$t" ]; then
28
28
fi
29
29
30
30
# Test file
31
- if [ ! -d " /Applications/$1 .app" ]; then
32
- echo " Application not found, make sure it's in /Application folder"
31
+ appPath=" "
32
+ if [ -d " /Applications/$1 .app" ]; then
33
+ appPath=" /Applications/$1 .app"
34
+ elif [ -d " $HOME /Applications/$1 .app" ]; then
35
+ appPath=" $HOME /Applications/$1 .app"
36
+ else
37
+ echo " Application not found, make sure it's in Applications folder"
33
38
exit 2
34
39
fi
35
40
@@ -43,13 +48,13 @@ if [ $omit -eq 0 ] && [ $3 = "y" -o $3 = "Y" ]; then
43
48
fi
44
49
45
50
if [ $2 ] && [ $omit -eq 0 ]; then
46
- echo $2 | sudo -S iconsur set " /Applications/ $1 .app " $loc
51
+ echo $2 | sudo -S iconsur set " $appPath " $loc
47
52
if [ ${PIPESTATUS[1]} -eq 1 ]; then
48
53
echo " Password incorrect"
49
54
exit 0
50
55
fi
51
56
else
52
- iconsur set " /Applications/ $1 .app " $loc
57
+ iconsur set " $appPath " $loc
53
58
if [ ${PIPESTATUS[0]} -eq 1 ]; then
54
59
echo " It didn't work, try again with password"
55
60
exit 0
You can’t perform that action at this time.
0 commit comments