Skip to content

Commit 24fea48

Browse files
StevenRCE0dehesa
authored andcommitted
Update iconsur.sh
1 parent 8a6da72 commit 24fea48

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

commands/apps/iconsur/iconsur.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ if [ -z "$t" ]; then
2828
fi
2929

3030
# 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"
3338
exit 2
3439
fi
3540

@@ -43,13 +48,13 @@ if [ $omit -eq 0 ] && [ $3 = "y" -o $3 = "Y" ]; then
4348
fi
4449

4550
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
4752
if [ ${PIPESTATUS[1]} -eq 1 ]; then
4853
echo "Password incorrect"
4954
exit 0
5055
fi
5156
else
52-
iconsur set "/Applications/$1.app" $loc
57+
iconsur set "$appPath" $loc
5358
if [ ${PIPESTATUS[0]} -eq 1 ]; then
5459
echo "It didn't work, try again with password"
5560
exit 0

0 commit comments

Comments
 (0)